diff options
author | Christian Brauner <brauner@kernel.org> | 2022-04-20 15:19:25 +0200 |
---|---|---|
committer | Christian Brauner (Microsoft) <brauner@kernel.org> | 2022-04-21 17:57:37 +0200 |
commit | 0014edaedfd804dbf35b009808789325ca615716 (patch) | |
tree | bf07760ffe166cfeaacbbd45281f51242af3d796 /kernel/kexec.c | |
parent | b2d229d4ddb17db541098b83524d901257e93845 (diff) | |
download | linux-0014edaedfd804dbf35b009808789325ca615716.tar.gz linux-0014edaedfd804dbf35b009808789325ca615716.tar.bz2 linux-0014edaedfd804dbf35b009808789325ca615716.zip |
fs: unset MNT_WRITE_HOLD on failure
After mnt_hold_writers() has been called we will always have set MNT_WRITE_HOLD
and consequently we always need to pair mnt_hold_writers() with
mnt_unhold_writers(). After the recent cleanup in [1] where Al switched from a
do-while to a for loop the cleanup currently fails to unset MNT_WRITE_HOLD for
the first mount that was changed. Fix this and make sure that the first mount
will be cleaned up and add some comments to make it more obvious.
Link: https://lore.kernel.org/lkml/0000000000007cc21d05dd0432b8@google.com
Link: https://lore.kernel.org/lkml/00000000000080e10e05dd043247@google.com
Link: https://lore.kernel.org/r/20220420131925.2464685-1-brauner@kernel.org
Fixes: e257039f0fc7 ("mount_setattr(): clean the control flow and calling conventions") [1]
Cc: Hillf Danton <hdanton@sina.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Reported-by: syzbot+10a16d1c43580983f6a2@syzkaller.appspotmail.com
Reported-by: syzbot+306090cfa3294f0bbfb3@syzkaller.appspotmail.com
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Diffstat (limited to 'kernel/kexec.c')
0 files changed, 0 insertions, 0 deletions