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:44:19 +0000 (06:44 +0100)
commitf213a0f926de3a3794c6bcf60c3699a62615535a
treea912366b4cbb416d1007effb92f64ec5cbd37cb1
parent88cf812869fd2dcbfef7e39fb71a1062b42829dc
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