summaryrefslogtreecommitdiff
path: root/fs/xattr.c
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2007-04-24 01:41:17 +0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-04-24 19:23:09 +0400
commit9b7f375505f5611efb562065b57814b28a81abc3 (patch)
tree3f51e49ca5b70081bf15f4ce9d7ddbd289917932 /fs/xattr.c
parent1a641fceb6bb6b0930db1aadbda1aaf5711d65d6 (diff)
downloadlinux-9b7f375505f5611efb562065b57814b28a81abc3.tar.xz
reiserfs: fix xattr root locking/refcount bug
The listxattr() and getxattr() operations are only protected by a read lock. As a result, if either of these operations run in parallel, a race condition exists where the xattr_root will end up being cached twice, which results in the leaking of a reference and a BUG() on umount. This patch refactors get_xa_root(), __get_xa_root(), and create_xa_root(), into one get_xa_root() function that takes the appropriate locking around the entire critical section. Reported, diagnosed and tested by Andrea Righi <a.righi@cineca.it> Signed-off-by: Jeff Mahoney <jeffm@suse.com> Cc: Andrea Righi <a.righi@cineca.it> Cc: "Vladimir V. Saveliev" <vs@namesys.com> Cc: Edward Shishkin <edward@namesys.com> Cc: Alex Zarochentsev <zam@namesys.com> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/xattr.c')
0 files changed, 0 insertions, 0 deletions