diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/reiserfs/xattr.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index a0e2e7acdc75..c320c7792c75 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c | |||
@@ -234,17 +234,22 @@ static int reiserfs_for_each_xattr(struct inode *inode, | |||
234 | if (IS_PRIVATE(inode) || get_inode_sd_version(inode) == STAT_DATA_V1) | 234 | if (IS_PRIVATE(inode) || get_inode_sd_version(inode) == STAT_DATA_V1) |
235 | return 0; | 235 | return 0; |
236 | 236 | ||
237 | reiserfs_write_unlock(inode->i_sb); | ||
237 | dir = open_xa_dir(inode, XATTR_REPLACE); | 238 | dir = open_xa_dir(inode, XATTR_REPLACE); |
238 | if (IS_ERR(dir)) { | 239 | if (IS_ERR(dir)) { |
239 | err = PTR_ERR(dir); | 240 | err = PTR_ERR(dir); |
241 | reiserfs_write_lock(inode->i_sb); | ||
240 | goto out; | 242 | goto out; |
241 | } else if (!dir->d_inode) { | 243 | } else if (!dir->d_inode) { |
242 | err = 0; | 244 | err = 0; |
245 | reiserfs_write_lock(inode->i_sb); | ||
243 | goto out_dir; | 246 | goto out_dir; |
244 | } | 247 | } |
245 | 248 | ||
246 | reiserfs_mutex_lock_nested_safe(&dir->d_inode->i_mutex, I_MUTEX_XATTR, | 249 | mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_XATTR); |
247 | inode->i_sb); | 250 | |
251 | reiserfs_write_lock(inode->i_sb); | ||
252 | |||
248 | buf.xadir = dir; | 253 | buf.xadir = dir; |
249 | err = reiserfs_readdir_dentry(dir, &buf, fill_with_dentries, &pos); | 254 | err = reiserfs_readdir_dentry(dir, &buf, fill_with_dentries, &pos); |
250 | while ((err == 0 || err == -ENOSPC) && buf.count) { | 255 | while ((err == 0 || err == -ENOSPC) && buf.count) { |