Skip to content

Commit

Permalink
[PATCH] Fix reiserfs deadlock
Browse files Browse the repository at this point in the history
reiserfs_cache_default_acl() should return whether we successfully found
the acl or not.  We have to return correct value even if reiserfs_get_acl()
returns error code and not just 0.  Otherwise callers such as
reiserfs_mkdir() can unnecessarily lock the xattrs and later functions such
as reiserfs_new_inode() fail to notice that we have already taken the lock
and try to take it again with obvious consequences.

Signed-off-by: Jan Kara <jack@suse.cz>
Cc: <reiserfs-dev@namesys.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Jan Kara authored and Linus Torvalds committed Apr 22, 2006
1 parent 8c4335a commit b9251b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/reiserfs/xattr_acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,9 @@ int reiserfs_cache_default_acl(struct inode *inode)
acl = reiserfs_get_acl(inode, ACL_TYPE_DEFAULT);
reiserfs_read_unlock_xattrs(inode->i_sb);
reiserfs_read_unlock_xattr_i(inode);
ret = acl ? 1 : 0;
posix_acl_release(acl);
ret = (acl && !IS_ERR(acl));
if (ret)
posix_acl_release(acl);
}

return ret;
Expand Down

0 comments on commit b9251b8

Please sign in to comment.