mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
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>
This commit is contained in:
parent
12abb35a03
commit
ceb5edc457
2 changed files with 3 additions and 3 deletions
|
@ -448,13 +448,11 @@ int remove_save_link(struct inode *inode, int truncate)
|
|||
static void reiserfs_kill_sb(struct super_block *s)
|
||||
{
|
||||
if (REISERFS_SB(s)) {
|
||||
#ifdef CONFIG_REISERFS_FS_XATTR
|
||||
if (REISERFS_SB(s)->xattr_root) {
|
||||
d_invalidate(REISERFS_SB(s)->xattr_root);
|
||||
dput(REISERFS_SB(s)->xattr_root);
|
||||
REISERFS_SB(s)->xattr_root = NULL;
|
||||
}
|
||||
#endif
|
||||
if (REISERFS_SB(s)->priv_root) {
|
||||
d_invalidate(REISERFS_SB(s)->priv_root);
|
||||
dput(REISERFS_SB(s)->priv_root);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue