Do not busy the UFS mount point inside VOP_RENAME(). The

kern_renameat() already starts write on the mp, which prevents
parallel unmount from proceed.  Busying mp after vn_start_write()
deadlocks the unmount.

Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2014-08-20 08:15:23 +00:00
parent 4ce90426e0
commit 29d03af1e4

View file

@ -1141,11 +1141,6 @@ ufs_rename(ap)
mp = NULL;
goto releout;
}
error = vfs_busy(mp, 0);
if (error) {
mp = NULL;
goto releout;
}
relock:
/*
* We need to acquire 2 to 4 locks depending on whether tvp is NULL
@ -1545,8 +1540,6 @@ unlockout:
if (error == 0 && tdp->i_flag & IN_NEEDSYNC)
error = VOP_FSYNC(tdvp, MNT_WAIT, td);
vput(tdvp);
if (mp)
vfs_unbusy(mp);
return (error);
bad:
@ -1564,8 +1557,6 @@ releout:
vrele(tdvp);
if (tvp)
vrele(tvp);
if (mp)
vfs_unbusy(mp);
return (error);
}