]> git.baikalelectronics.ru Git - kernel.git/commit
reiserfs: fix race in readdir
authorJeff Mahoney <jeffm@suse.com>
Wed, 2 Apr 2014 18:40:26 +0000 (14:40 -0400)
committerJan Kara <jack@suse.cz>
Wed, 2 Apr 2014 22:06:14 +0000 (00:06 +0200)
commit580aaf8df19cec0273b260b30dc2d8c3decdb6c8
tree212ac3940dc154fc2cffe0917c18e15e6e685ee3
parent5ca06dfafeb3219935a9959910b92733b5a02260
reiserfs: fix race in readdir

jdm-20004 reiserfs_delete_xattrs: Couldn't delete all xattrs (-2)

The -ENOENT is due to readdir calling dir_emit on the same entry twice.

If the dir_emit callback sleeps and the tree is changed underneath us,
we won't be able to trust deh_offset(deh) anymore. We need to save
next_pos before we might sleep so we can find the next entry.

CC: stable@vger.kernel.org
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/reiserfs/dir.c