]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: bugfix for alloc_nid_failed()
authorHaicheng Li <haicheng.li@linux.intel.com>
Mon, 6 May 2013 15:15:41 +0000 (23:15 +0800)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Wed, 8 May 2013 10:54:20 +0000 (19:54 +0900)
commit920a5d6a4ceab27d7535b32326ed706b1fbb120b
tree9655200dfab3fb8efa94dfb84c1ff7fb9b451e64
parent2864b81c8acaa6a5e92035f4debd465750b8d16f
f2fs: bugfix for alloc_nid_failed()

Directly drop the free_nid cache when nm_i->fcnt > 2 * MAX_FREE_NIDS

Since there is NOT nmi->free_nid_list_lock spinlock protection between
a sequential calling of alloc_nid() and alloc_nid_failed(), some other
threads may already add new free_nid to the free_nid_list during this
period.

We need to make sure nmi->fcnt is never > 2 * MAX_FREE_NIDS.

Signed-off-by: Haicheng Li <haicheng.li@linux.intel.com>
[Jaegeuk Kim: fit the coding style]
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
fs/f2fs/node.c