]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ovl: reorder ovl_want_write() after ovl_inode_lock()
authorAmir Goldstein <amir73il@gmail.com>
Thu, 20 Jul 2023 09:51:21 +0000 (12:51 +0300)
committerAmir Goldstein <amir73il@gmail.com>
Mon, 30 Oct 2023 22:12:57 +0000 (00:12 +0200)
commit162d06444070c12827d604a2cb6b6bd98d48cbb0
treeaa5ac2ffb3dce2d74c3fb7812b3ea37abca90a99
parentd08d3b3c2caf6c482703bbc5efaa7b9ae95dea20
ovl: reorder ovl_want_write() after ovl_inode_lock()

Make the locking order of ovl_inode_lock() strictly between the two
vfs stacked layers, i.e.:
- ovl vfs locks: sb_writers, inode_lock, ...
- ovl_inode_lock
- upper vfs locks: sb_writers, inode_lock, ...

To that effect, move ovl_want_write() into the helpers ovl_nlink_start()
and ovl_copy_up_start which currently take the ovl_inode_lock() after
ovl_want_write().

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
fs/overlayfs/copy_up.c
fs/overlayfs/dir.c
fs/overlayfs/export.c
fs/overlayfs/inode.c
fs/overlayfs/util.c