summaryrefslogtreecommitdiffstats
path: root/include/net/nexthop.h
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2017-01-25 07:53:43 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-05-30 07:48:52 +0200
commit1a54258e10b23c6877d699ef6cf3f2b02b17b87f (patch)
tree2fce88ad2fb0bd635c3402bf35270fb6de3b7888 /include/net/nexthop.h
parentcb1c92e55420dad73ce717ef4029dd6e984dcbd0 (diff)
downloadlinux-stable-1a54258e10b23c6877d699ef6cf3f2b02b17b87f.tar.gz
linux-stable-1a54258e10b23c6877d699ef6cf3f2b02b17b87f.tar.bz2
linux-stable-1a54258e10b23c6877d699ef6cf3f2b02b17b87f.zip
xfs: remove racy hasattr check from attr ops
commit 5a93790d4e2df73e30c965ec6e49be82fc3ccfce upstream. xfs_attr_[get|remove]() have unlocked attribute fork checks to optimize away a lock cycle in cases where the fork does not exist or is otherwise empty. This check is not safe, however, because an attribute fork short form to extent format conversion includes a transient state that causes the xfs_inode_hasattr() check to fail. Specifically, xfs_attr_shortform_to_leaf() creates an empty extent format attribute fork and then adds the existing shortform attributes to it. This means that lookup of an existing xattr can spuriously return -ENOATTR when racing against a setxattr that causes the associated format conversion. This was originally reproduced by an untar on a particularly configured glusterfs volume, but can also be reproduced on demand with properly crafted xattr requests. The format conversion occurs under the exclusive ilock. xfs_attr_get() and xfs_attr_remove() already have the proper locking and checks further down in the functions to handle this situation correctly. Drop the unlocked checks to avoid the spurious failure and rely on the existing logic. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Cc: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/net/nexthop.h')
0 files changed, 0 insertions, 0 deletions