Skip to content

Commit 7cca555

Browse files
committed
Merge tag 'ovl-fixes-6.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/overlayfs/vfs
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()
2 parents 055f213 + e8bd877 commit 7cca555

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

fs/overlayfs/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ struct dentry *ovl_create_temp(struct ovl_fs *ofs, struct dentry *workdir,
225225
struct ovl_cattr *attr)
226226
{
227227
struct dentry *ret;
228-
inode_lock(workdir->d_inode);
228+
inode_lock_nested(workdir->d_inode, I_MUTEX_PARENT);
229229
ret = ovl_create_real(ofs, workdir,
230230
ovl_lookup_temp(ofs, workdir), attr);
231231
inode_unlock(workdir->d_inode);

fs/overlayfs/util.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1552,7 +1552,8 @@ void ovl_copyattr(struct inode *inode)
15521552
int ovl_parent_lock(struct dentry *parent, struct dentry *child)
15531553
{
15541554
inode_lock_nested(parent->d_inode, I_MUTEX_PARENT);
1555-
if (!child || child->d_parent == parent)
1555+
if (!child ||
1556+
(!d_unhashed(child) && child->d_parent == parent))
15561557
return 0;
15571558

15581559
inode_unlock(parent->d_inode);

0 commit comments

Comments
 (0)