diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/notify/inode_mark.c | 17 | ||||
-rw-r--r-- | fs/ocfs2/namei.c | 2 |
2 files changed, 12 insertions, 7 deletions
diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c index 9ce062218de9..e8497144b323 100644 --- a/fs/notify/inode_mark.c +++ b/fs/notify/inode_mark.c | |||
@@ -288,20 +288,25 @@ void fsnotify_unmount_inodes(struct list_head *list) | |||
288 | spin_unlock(&inode->i_lock); | 288 | spin_unlock(&inode->i_lock); |
289 | 289 | ||
290 | /* In case the dropping of a reference would nuke next_i. */ | 290 | /* In case the dropping of a reference would nuke next_i. */ |
291 | if ((&next_i->i_sb_list != list) && | 291 | while (&next_i->i_sb_list != list) { |
292 | atomic_read(&next_i->i_count)) { | ||
293 | spin_lock(&next_i->i_lock); | 292 | spin_lock(&next_i->i_lock); |
294 | if (!(next_i->i_state & (I_FREEING | I_WILL_FREE))) { | 293 | if (!(next_i->i_state & (I_FREEING | I_WILL_FREE)) && |
294 | atomic_read(&next_i->i_count)) { | ||
295 | __iget(next_i); | 295 | __iget(next_i); |
296 | need_iput = next_i; | 296 | need_iput = next_i; |
297 | spin_unlock(&next_i->i_lock); | ||
298 | break; | ||
297 | } | 299 | } |
298 | spin_unlock(&next_i->i_lock); | 300 | spin_unlock(&next_i->i_lock); |
301 | next_i = list_entry(next_i->i_sb_list.next, | ||
302 | struct inode, i_sb_list); | ||
299 | } | 303 | } |
300 | 304 | ||
301 | /* | 305 | /* |
302 | * We can safely drop inode_sb_list_lock here because we hold | 306 | * We can safely drop inode_sb_list_lock here because either |
303 | * references on both inode and next_i. Also no new inodes | 307 | * we actually hold references on both inode and next_i or |
304 | * will be added since the umount has begun. | 308 | * end of list. Also no new inodes will be added since the |
309 | * umount has begun. | ||
305 | */ | 310 | */ |
306 | spin_unlock(&inode_sb_list_lock); | 311 | spin_unlock(&inode_sb_list_lock); |
307 | 312 | ||
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 8add6f1030d7..b931e04e3388 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c | |||
@@ -158,7 +158,7 @@ bail_add: | |||
158 | * NOTE: This dentry already has ->d_op set from | 158 | * NOTE: This dentry already has ->d_op set from |
159 | * ocfs2_get_parent() and ocfs2_get_dentry() | 159 | * ocfs2_get_parent() and ocfs2_get_dentry() |
160 | */ | 160 | */ |
161 | if (ret) | 161 | if (!IS_ERR_OR_NULL(ret)) |
162 | dentry = ret; | 162 | dentry = ret; |
163 | 163 | ||
164 | status = ocfs2_dentry_attach_lock(dentry, inode, | 164 | status = ocfs2_dentry_attach_lock(dentry, inode, |