gfs2_atomic_open(): fix O_EXCL|O_CREAT handling on cold dcache
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 10 Mar 2020 13:31:41 +0000 (09:31 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Mar 2020 08:07:44 +0000 (09:07 +0100)
commitc919b9a148295a8fbae25f328027c0d9a0c61465
treea1275adfa564a23f2b4ff013f92b9dd691ef066f
parentca9a513b01100a557f99fe69abcd3d664ff88b40
gfs2_atomic_open(): fix O_EXCL|O_CREAT handling on cold dcache

commit 21039132650281de06a169cbe8a0f7e5c578fd8b upstream.

with the way fs/namei.c:do_last() had been done, ->atomic_open()
instances needed to recognize the case when existing file got
found with O_EXCL|O_CREAT, either by falling back to finish_no_open()
or failing themselves.  gfs2 one didn't.

Fixes: 6d4ade986f9c (GFS2: Add atomic_open support)
Cc: stable@kernel.org # v3.11
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/gfs2/inode.c