Commit 7cca555b authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull overlayfs fixes from Amir Goldstein:
 "Fixes for two fallouts from Neil's directory locking changes"

* tag 'ovl-fixes-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs:
  ovl: fix possible double unlink
  ovl: use I_MUTEX_PARENT when locking parent in ovl_create_temp()
parents 055f2130 e8bd877f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -225,7 +225,7 @@ struct dentry *ovl_create_temp(struct ovl_fs *ofs, struct dentry *workdir,
			       struct ovl_cattr *attr)
{
	struct dentry *ret;
	inode_lock(workdir->d_inode);
	inode_lock_nested(workdir->d_inode, I_MUTEX_PARENT);
	ret = ovl_create_real(ofs, workdir,
			      ovl_lookup_temp(ofs, workdir), attr);
	inode_unlock(workdir->d_inode);
+2 −1
Original line number Diff line number Diff line
@@ -1552,7 +1552,8 @@ void ovl_copyattr(struct inode *inode)
int ovl_parent_lock(struct dentry *parent, struct dentry *child)
{
	inode_lock_nested(parent->d_inode, I_MUTEX_PARENT);
	if (!child || child->d_parent == parent)
	if (!child ||
	    (!d_unhashed(child) && child->d_parent == parent))
		return 0;

	inode_unlock(parent->d_inode);