minix: fix error handling in minix_set_link
authorChristoph Hellwig <hch@lst.de>
Wed, 18 Jan 2023 17:30:23 +0000 (18:30 +0100)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 20 Jan 2023 00:26:34 +0000 (19:26 -0500)
commit2d1a9d599b3ed9b9c58f64b8b71b5b9d770ceacf
tree05fbead28b1adb47e8dcc4535b6b1492bef59b97
parentb61d15d5ff67c07907c194d4354ec0c35bc657d1
minix: fix error handling in minix_set_link

If minix_prepare_chunk fails, updating c/mtime and marking the
dir inode dirty is wrong, as the inode hasn't been modified.  Also
propagate the error to the caller.

Note that this moves the dir_put_page call later, but that matches
other uses of this helper in the directory code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/minix/dir.c
fs/minix/minix.h
fs/minix/namei.c