This is a note to let you know that I've just added the patch titled reiserfs: fix spurious multiple-fill in reiserfs_readdir_dentry to the 3.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: reiserfs-fix-spurious-multiple-fill-in-reiserfs_readdir_dentry.patch and it can be found in the queue-3.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 0bdc7acba56a7ca4232f15f37b16f7ec079385ab Mon Sep 17 00:00:00 2001 From: Jeff Mahoney <jeffm@xxxxxxxxxxxxxxxxxx> Date: Fri, 31 May 2013 15:07:52 -0400 Subject: reiserfs: fix spurious multiple-fill in reiserfs_readdir_dentry From: Jeff Mahoney <jeffm@xxxxxxxxxxxxxxxxxx> commit 0bdc7acba56a7ca4232f15f37b16f7ec079385ab upstream. 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@xxxxxxxx> Signed-off-by: Jan Kara <jack@xxxxxxx> Signed-off-by: Jonghwan Choi <jhbird.choi@xxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/reiserfs/dir.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/reiserfs/dir.c +++ b/fs/reiserfs/dir.c @@ -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 */ Patches currently in stable-queue which might be from jeffm@xxxxxxxxxxxxxxxxxx are queue-3.9/reiserfs-fix-spurious-multiple-fill-in-reiserfs_readdir_dentry.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html