diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index bd073836e141..d8ced8580bf1 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c @@ -1003,6 +1003,7 @@ int reiserfs_xattr_init(struct super_block *s, int mount_flags) int err = 0; struct dentry *privroot = REISERFS_SB(s)->priv_root; + current->xattr_check_error = 0; err = xattr_mount_check(s); if (err) goto error; @@ -1040,5 +1041,7 @@ int reiserfs_xattr_init(struct super_block *s, int mount_flags) else s->s_flags &= ~SB_POSIXACL; + BUG_ON(current->xattr_check_error && !err); + current->xattr_check_error = 0; return err; } diff --git a/fs/reiserfs/xattr.h b/fs/reiserfs/xattr.h index 9b3b06da568c..239597f44d2e 100644 --- a/fs/reiserfs/xattr.h +++ b/fs/reiserfs/xattr.h @@ -44,7 +44,8 @@ void reiserfs_security_free(struct reiserfs_security_handle *sec); static inline int reiserfs_xattrs_initialized(struct super_block *sb) { - return REISERFS_SB(sb)->priv_root != NULL; + current->xattr_check_error = REISERFS_SB(sb)->priv_root && !REISERFS_SB(sb)->xattr_root; + return REISERFS_SB(sb)->priv_root && REISERFS_SB(sb)->xattr_root; } #define xattr_size(size) ((size) + sizeof(struct reiserfs_xattr_header)) diff --git a/include/linux/sched.h b/include/linux/sched.h index ef00bb22164c..8b2956654c48 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -841,6 +841,7 @@ struct task_struct { /* Stalled due to lack of memory */ unsigned in_memstall:1; #endif + unsigned xattr_check_error:1; unsigned long atomic_flags; /* Flags requiring atomic access. */