summaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/xattr.c
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2009-05-17 07:02:02 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2009-05-17 20:45:45 +0200
commitceb5edc457f07956c82dccfb54ca8ae7e2a399f0 (patch)
tree0b58e5a5e359090e47583ec0b49e7b29af0b2179 /fs/reiserfs/xattr.c
parentreiserfs: clean up ifdefs (diff)
downloadlinux-ceb5edc457f07956c82dccfb54ca8ae7e2a399f0.tar.xz
linux-ceb5edc457f07956c82dccfb54ca8ae7e2a399f0.zip
reiserfs: deal with NULL xattr root w/ xattrs disabled
This avoids an Oops in open_xa_root that can occur when deleting a file with xattrs disabled. It assumes that the xattr root will be there, and that is not guaranteed. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/reiserfs/xattr.c')
-rw-r--r--fs/reiserfs/xattr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index cf949646dd57..628075ca82c1 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -123,7 +123,9 @@ static struct dentry *open_xa_root(struct super_block *sb, int flags)
mutex_lock_nested(&privroot->d_inode->i_mutex, I_MUTEX_XATTR);
xaroot = dget(REISERFS_SB(sb)->xattr_root);
- if (!xaroot->d_inode) {
+ if (!xaroot)
+ xaroot = ERR_PTR(-ENODATA);
+ else if (!xaroot->d_inode) {
int err = -ENODATA;
if (xattr_may_create(flags))
err = xattr_mkdir(privroot->d_inode, xaroot, 0700);