]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitd66ae04368a53816a464861019cad0727a94054a
treeb278bf6a0756b176ef84b61b65e981e8afe8cd8c
parentb1aeaee8b8eeb5fb57a353a74698bc72b6eb1183
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