diff options
author | Jan Kara <jack@suse.cz> | 2014-12-10 15:41:40 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-10 17:41:03 -0800 |
commit | 2b693005b833ba309c7cb8426cd023d8e80da31e (patch) | |
tree | b0c38765711fd380f7cbb51f0d3cc2cb453fe7c2 /fs/ocfs2/xattr.c | |
parent | 519a286175b6422e13694ebb73aefee0b5749443 (diff) | |
download | op-kernel-dev-2b693005b833ba309c7cb8426cd023d8e80da31e.zip op-kernel-dev-2b693005b833ba309c7cb8426cd023d8e80da31e.tar.gz |
ocfs2: Fix xattr check in ocfs2_get_xattr_nolock()
ocfs2_get_xattr_nolock() checks whether inode has any extended attributes
(OCFS2_HAS_XATTR_FL). If not, it just sets 'ret' to -ENODATA but
continues with checking inline and external attributes anyway (which is
pointless although it does not harm). Just return immediately when we
know there are no extended attributes in the inode.
Coverity id: 1226906.
Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2/xattr.c')
-rw-r--r-- | fs/ocfs2/xattr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 016f01d..662f8de 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c @@ -1284,7 +1284,7 @@ int ocfs2_xattr_get_nolock(struct inode *inode, return -EOPNOTSUPP; if (!(oi->ip_dyn_features & OCFS2_HAS_XATTR_FL)) - ret = -ENODATA; + return -ENODATA; xis.inode_bh = xbs.inode_bh = di_bh; di = (struct ocfs2_dinode *)di_bh->b_data; |