f2fs: fix multiple f2fs_add_link() calls having same name
authorJaegeuk Kim <jaegeuk@kernel.org>
Tue, 14 Feb 2017 17:54:37 +0000 (09:54 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 12 Mar 2017 05:41:51 +0000 (06:41 +0100)
commitd00d1b71d98468ad6fbee590705c27fc1241f96e
tree2d7cc75a50ac66d8f7c478c99dfb3b692a9a8bc3
parentec160ad2acaad4a7de6eab7338ef5e3b2b19f907
f2fs: fix multiple f2fs_add_link() calls having same name

commit 88c5c13a5027b36d914536fdba23f069d7067204 upstream.

It turns out a stakable filesystem like sdcardfs in AOSP can trigger multiple
vfs_create() to lower filesystem. In that case, f2fs will add multiple dentries
having same name which breaks filesystem consistency.

Until upper layer fixes, let's work around by f2fs, which shows actually not
much performance regression.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/f2fs/dir.c
fs/f2fs/f2fs.h