Unlock correct lock in ffs_snapblkfree().
It is possible for ffs_snapblkfree() to race and lock snaplock while the devvp snapdata is instantiated, but no snapshots exist. In this case the loop over snapshots in ffs_snapblkfree() is not executed, and the local variable vp is left initialized to NULL. Unlock using &sn->sn_lock and not vp->v_vnlock. For the inodes on the snapshot list, the locks are same. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
This commit is contained in:
parent
f2e6bf5c05
commit
c536471408
@ -1935,7 +1935,7 @@ retry:
|
||||
*/
|
||||
if (error != 0 && wkhd != NULL)
|
||||
softdep_freework(wkhd);
|
||||
lockmgr(vp->v_vnlock, LK_RELEASE, NULL);
|
||||
lockmgr(&sn->sn_lock, LK_RELEASE, NULL);
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user