Skip to content
Commit 59bbd474 authored by Jaegeuk Kim's avatar Jaegeuk Kim
Browse files

f2fs: cover free_nid management with spin_lock



After build_free_nids() searches free nid candidates from nat pages and
current journal blocks, it checks all the candidates if they are allocated
so that the nat cache has its nid with an allocated block address.

In this procedure, previously we used
    list_for_each_entry_safe(fnid, next_fnid, &nm_i->free_nid_list, list).
But, this is not covered by free_nid_list_lock, resulting in null pointer bug.

This patch moves this checking routine inside add_free_nid() in order not to use
the spin_lock.

Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent 23d38844
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment