Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2013-05-31 16:04:37 -0400
committerJeff Mahoney <jeffm@suse.com>2013-05-31 16:04:37 -0400
commitf5a0e1f2fc85b4add7542fb720cfb3465bc912e6 (patch)
tree3933f31fd50ed2580aa982ef688a2d4df52aa5f6
parent497d098bcf8620b5fa54dfe2235fdc1d3e5fc51d (diff)
- patches.fixes/reiserfs-fix-spurious-multiple-fill-in-reiserfs_readdir_dentry:
reiserfs: fix spurious multiple-fill in reiserfs_readdir_dentry (bnc#822722).
-rw-r--r--kernel-source.changes7
-rw-r--r--patches.fixes/reiserfs-fix-spurious-multiple-fill-in-reiserfs_readdir_dentry42
-rw-r--r--series.conf1
3 files changed, 50 insertions, 0 deletions
diff --git a/kernel-source.changes b/kernel-source.changes
index dc2bdd0fc3..d0bc8010d1 100644
--- a/kernel-source.changes
+++ b/kernel-source.changes
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Fri May 31 22:04:26 CEST 2013 - jeffm@suse.com
+
+- patches.fixes/reiserfs-fix-spurious-multiple-fill-in-reiserfs_readdir_dentry:
+ reiserfs: fix spurious multiple-fill in reiserfs_readdir_dentry
+ (bnc#822722).
+
+-------------------------------------------------------------------
Fri May 31 14:17:50 CEST 2013 - mkubecek@suse.cz
- patches.fixes/SCSI-libfc-don-t-exch_done-on-invalid-sequence-ptr.patch:
diff --git a/patches.fixes/reiserfs-fix-spurious-multiple-fill-in-reiserfs_readdir_dentry b/patches.fixes/reiserfs-fix-spurious-multiple-fill-in-reiserfs_readdir_dentry
new file mode 100644
index 0000000000..dbc60f560c
--- /dev/null
+++ b/patches.fixes/reiserfs-fix-spurious-multiple-fill-in-reiserfs_readdir_dentry
@@ -0,0 +1,42 @@
+From: Jeff Mahoney <jeffm@suse.com>
+Subject: reiserfs: fix spurious multiple-fill in reiserfs_readdir_dentry
+References: bnc#822722
+Patch-mainline: Submitted to reiserfs-devel 31 May 2013
+
+After sleeping for filldir(), we check to see if the file system has
+changed and research. The next_pos pointer is updated but its value
+isn't pushed into the key used for the search itself. As a result,
+the search returns the same item that the last cycle of the loop did
+and filldir() is called multiple times with the same data.
+
+The end result is that the buffer can contain the same name multiple
+times. This can be returned to userspace or used internally in the
+xattr code where it can manifest with the following warning:
+
+jdm-20004 reiserfs_delete_xattrs: Couldn't delete all xattrs (-2)
+
+reiserfs_for_each_xattr uses reiserfs_readdir_dentry to iterate over
+the xattr names and ends up trying to unlink the same name twice. The
+second attempt fails with -ENOENT and the error is returned. At some
+point I'll need to add support into reiserfsck to remove the orphaned
+directories left behind when this occurs.
+
+The fix is to push the value into the key before researching.
+
+Signed-off-by: Jeff Mahoney <jeffm@suse.com>
+---
+ fs/reiserfs/dir.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/fs/reiserfs/dir.c 2013-05-31 14:29:35.945840685 -0400
++++ b/fs/reiserfs/dir.c 2013-05-31 14:30:05.473952112 -0400
+@@ -204,6 +204,8 @@ int reiserfs_readdir_dentry(struct dentr
+ next_pos = deh_offset(deh) + 1;
+
+ if (item_moved(&tmp_ih, &path_to_entry)) {
++ set_cpu_key_k_offset(&pos_key,
++ next_pos);
+ goto research;
+ }
+ } /* for */
+
diff --git a/series.conf b/series.conf
index bdb96ce863..f9c0c4ede7 100644
--- a/series.conf
+++ b/series.conf
@@ -1778,6 +1778,7 @@
patches.fixes/reiserfs-fix-deadlock-with-nfs-racing-on-create-lookup
patches.fixes/reiserfs-unlock-superblock-before-calling-reiserfs_quota_on_mount.patch
patches.fixes/reiserfs-fix-problems-with-chowning-setuid-file-w-xattrs
+ patches.fixes/reiserfs-fix-spurious-multiple-fill-in-reiserfs_readdir_dentry
########################################################
# dlm