diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index adfb41b45b1c..8557edcdb1f5 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -424,6 +424,15 @@ ffs_snapshot(mp, snapfile) MNT_ILOCK(mp); continue; } + /* + * We can skip parent directory vnode because it must have + * this snapshot file in it. + */ + if (xvp == nd.ni_dvp) { + VI_UNLOCK(xvp); + MNT_ILOCK(mp); + continue; + } if (vn_lock(xvp, LK_EXCLUSIVE | LK_INTERLOCK, td) != 0) { MNT_ILOCK(mp); goto loop;