]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Unlock correct lock in ffs_snapblkfree().
authorKonstantin Belousov <kib@FreeBSD.org>
Fri, 21 Jul 2017 18:36:17 +0000 (18:36 +0000)
committerKonstantin Belousov <kib@FreeBSD.org>
Fri, 21 Jul 2017 18:36:17 +0000 (18:36 +0000)
commitc5364714080e88b1b20c93196caae700ff5a3af3
tree72a83406c7f3e948bb719cc3dec00fb963b843ed
parentf2e6bf5c0569d3c761eb26ad47108e2efef650b4
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
sys/ufs/ffs/ffs_snapshot.c