aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2013-03-29 15:39:16 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-12 09:18:08 -0700
commit06cc39593b0a9fed3f8ecbed6d30d8c3368ccbe0 (patch)
treeb4eb94744084833d0b390b38ff8ede2a5c36da46 /fs/reiserfs
parent1ae92500b8c8b67f02071c38ee0d54701e036e59 (diff)
downloadkernel_samsung_smdk4412-06cc39593b0a9fed3f8ecbed6d30d8c3368ccbe0.zip
kernel_samsung_smdk4412-06cc39593b0a9fed3f8ecbed6d30d8c3368ccbe0.tar.gz
kernel_samsung_smdk4412-06cc39593b0a9fed3f8ecbed6d30d8c3368ccbe0.tar.bz2
reiserfs: Fix warning and inode leak when deleting inode with xattrs
commit 35e5cbc0af240778e61113286c019837e06aeec6 upstream. After commit 21d8a15a (lookup_one_len: don't accept . and ..) reiserfs started failing to delete xattrs from inode. This was due to a buggy test for '.' and '..' in fill_with_dentries() which resulted in passing '.' and '..' entries to lookup_one_len() in some cases. That returned error and so we failed to iterate over all xattrs of and inode. Fix the test in fill_with_dentries() along the lines of the one in lookup_one_len(). Reported-by: Pawel Zawora <pzawora@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/reiserfs')
-rw-r--r--fs/reiserfs/xattr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index d780896..6e3ca4e 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -187,8 +187,8 @@ fill_with_dentries(void *buf, const char *name, int namelen, loff_t offset,
if (dbuf->count == ARRAY_SIZE(dbuf->dentries))
return -ENOSPC;
- if (name[0] == '.' && (name[1] == '\0' ||
- (name[1] == '.' && name[2] == '\0')))
+ if (name[0] == '.' && (namelen < 2 ||
+ (namelen == 2 && name[1] == '.')))
return 0;
dentry = lookup_one_len(name, dbuf->xadir, namelen);