do_last(): don't bother with keeping got_write in FMODE_OPENED case
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 26 Jan 2020 15:22:24 +0000 (10:22 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 14 Mar 2020 01:09:12 +0000 (21:09 -0400)
commit59e96e65833e05a9410327627d91ccef39392a25
treeb278bf6a0756b176ef84b61b65e981e8afe8cd8c
parent3ad5615a071f7c1c41b2e23b9ffde73b09499eb0
do_last(): don't bother with keeping got_write in FMODE_OPENED case

it's easier to drop it right after lookup_open() and regain if
needed (i.e. if we will need to truncate).  On the non-FMODE_OPENED
path we do that anyway.  In case of FMODE_CREATED we won't be
needing it.  And it's easier to prove correctness that way,
especially since the initial failure to get write access is not
always fatal; proving that we'll never end up truncating in that
case is rather convoluted.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c