svn commit: r322043 - stable/11/sys/ufs/ffs
Konstantin Belousov
kib at FreeBSD.org
Fri Aug 4 08:16:07 UTC 2017
Author: kib
Date: Fri Aug 4 08:16:05 2017
New Revision: 322043
URL: https://svnweb.freebsd.org/changeset/base/322043
Log:
MFC r321347:
Account for lock recursion when transfering snaplock to the vnode lock
in ffs_snapremove().
Modified:
stable/11/sys/ufs/ffs/ffs_snapshot.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/ufs/ffs/ffs_snapshot.c
==============================================================================
--- stable/11/sys/ufs/ffs/ffs_snapshot.c Fri Aug 4 08:12:19 2017 (r322042)
+++ stable/11/sys/ufs/ffs/ffs_snapshot.c Fri Aug 4 08:16:05 2017 (r322043)
@@ -1607,7 +1607,7 @@ ffs_snapremove(vp)
struct buf *ibp;
struct fs *fs;
ufs2_daddr_t numblks, blkno, dblk;
- int error, loc, last;
+ int error, i, last, loc;
struct snapdata *sn;
ip = VTOI(vp);
@@ -1627,10 +1627,14 @@ ffs_snapremove(vp)
ip->i_nextsnap.tqe_prev = 0;
VI_UNLOCK(devvp);
lockmgr(&vp->v_lock, LK_EXCLUSIVE, NULL);
+ for (i = 0; i < sn->sn_lock.lk_recurse; i++)
+ lockmgr(&vp->v_lock, LK_EXCLUSIVE, NULL);
KASSERT(vp->v_vnlock == &sn->sn_lock,
("ffs_snapremove: lost lock mutation"));
vp->v_vnlock = &vp->v_lock;
VI_LOCK(devvp);
+ while (sn->sn_lock.lk_recurse > 0)
+ lockmgr(&sn->sn_lock, LK_RELEASE, NULL);
lockmgr(&sn->sn_lock, LK_RELEASE, NULL);
try_free_snapdata(devvp);
} else
More information about the svn-src-stable
mailing list