From: Huang Ying Date: Fri, 12 Sep 2014 11:21:11 +0000 (+0800) Subject: f2fs: fix a race condition in next_free_nid X-Git-Tag: fixes-for-v3.18-merge-window~8^2~26 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6e489305eb5ed029002b037e36800032a994bb4;p=pandora-kernel.git f2fs: fix a race condition in next_free_nid The nm_i->fcnt checking is executed before spin_lock, so if another thread delete the last free_nid from the list, the wrong nid may be gotten. So fix the race condition by moving the nm_i->fnct checking into spin_lock. Signed-off-by: Huang, Ying Signed-off-by: Jaegeuk Kim --- Reading git-diff-tree failed