diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-29 19:38:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-29 19:38:48 -0400 |
commit | a7ca10f263d7e673c74d8e0946d6b9993405cc9c (patch) | |
tree | 7c50f0e728ca1a426235356acba1115c45dfe809 /fs/notify/inode_mark.c | |
parent | d506aa68c23db708ad45ca8c17f0d7f5d7029a37 (diff) | |
parent | 4d88e6f7d5ffc84e6094a47925870f4a130555c2 (diff) |
Merge branch 'akpm' (incoming from Andrew Morton)
Merge misc fixes from Andrew Morton:
"21 fixes"
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (21 commits)
mm/balloon_compaction: fix deflation when compaction is disabled
sh: fix sh770x SCIF memory regions
zram: avoid NULL pointer access in concurrent situation
mm/slab_common: don't check for duplicate cache names
ocfs2: fix d_splice_alias() return code checking
mm: rmap: split out page_remove_file_rmap()
mm: memcontrol: fix missed end-writeback page accounting
mm: page-writeback: inline account_page_dirtied() into single caller
lib/bitmap.c: fix undefined shift in __bitmap_shift_{left|right}()
drivers/rtc/rtc-bq32k.c: fix register value
memory-hotplug: clear pgdat which is allocated by bootmem in try_offline_node()
drivers/rtc/rtc-s3c.c: fix initialization failure without rtc source clock
kernel/kmod: fix use-after-free of the sub_info structure
drivers/rtc/rtc-pm8xxx.c: rework to support pm8941 rtc
mm, thp: fix collapsing of hugepages on madvise
drivers: of: add return value to of_reserved_mem_device_init()
mm: free compound page with correct order
gcov: add ARM64 to GCOV_PROFILE_ALL
fsnotify: next_i is freed during fsnotify_unmount_inodes.
mm/compaction.c: avoid premature range skip in isolate_migratepages_range
...
Diffstat (limited to 'fs/notify/inode_mark.c')
-rw-r--r-- | fs/notify/inode_mark.c | 17 |
1 files changed, 11 insertions, 6 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 | ||