diff options
| -rw-r--r-- | fs/reiserfs/xattr.c | 3 | ||||
| -rw-r--r-- | include/linux/reiserfs_fs.h | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index 58aa8e75f7f5..8891cd88a3f4 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c | |||
| @@ -243,7 +243,8 @@ static int reiserfs_for_each_xattr(struct inode *inode, | |||
| 243 | goto out_dir; | 243 | goto out_dir; |
| 244 | } | 244 | } |
| 245 | 245 | ||
| 246 | mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_XATTR); | 246 | reiserfs_mutex_lock_nested_safe(&dir->d_inode->i_mutex, I_MUTEX_XATTR, |
| 247 | inode->i_sb); | ||
| 247 | buf.xadir = dir; | 248 | buf.xadir = dir; |
| 248 | err = reiserfs_readdir_dentry(dir, &buf, fill_with_dentries, &pos); | 249 | err = reiserfs_readdir_dentry(dir, &buf, fill_with_dentries, &pos); |
| 249 | while ((err == 0 || err == -ENOSPC) && buf.count) { | 250 | while ((err == 0 || err == -ENOSPC) && buf.count) { |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index a05b4a20768d..4351b49e2b1e 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
| @@ -97,6 +97,15 @@ static inline void reiserfs_mutex_lock_safe(struct mutex *m, | |||
| 97 | reiserfs_write_lock(s); | 97 | reiserfs_write_lock(s); |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | static inline void | ||
| 101 | reiserfs_mutex_lock_nested_safe(struct mutex *m, unsigned int subclass, | ||
| 102 | struct super_block *s) | ||
| 103 | { | ||
| 104 | reiserfs_write_unlock(s); | ||
| 105 | mutex_lock_nested(m, subclass); | ||
| 106 | reiserfs_write_lock(s); | ||
| 107 | } | ||
| 108 | |||
| 100 | /* | 109 | /* |
| 101 | * When we schedule, we usually want to also release the write lock, | 110 | * When we schedule, we usually want to also release the write lock, |
| 102 | * according to the previous bkl based locking scheme of reiserfs. | 111 | * according to the previous bkl based locking scheme of reiserfs. |
