]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC: r350367
authorRick Macklem <rmacklem@FreeBSD.org>
Fri, 2 Aug 2019 01:59:58 +0000 (01:59 +0000)
committerRick Macklem <rmacklem@FreeBSD.org>
Fri, 2 Aug 2019 01:59:58 +0000 (01:59 +0000)
commit00312cd14feb1cbb20246c06db7746fe8eed5291
tree17476192644365acd29b0898c14219d25aae1284
parent6c73968dfee7afced42eca2dab14499fe4d4a432
MFC: r350367
Lock the vnode before calling ufs_bmap_seekdata().

r346932 replaced a call to vn_bmap_seekhole() with a call to
ufs_bmap_seekdata(). Although vn_bmap_seekhole() locks the vnode,
ufs_bmap_seekdata() assumes it is already locked.
This patch adds locking of the vnode before the ufs_bmap_seekdata() call.
If the vn_lock() call fails, it returns EBADF since that is the normal
error returned when a file system is forced dismounted and is already
listed as an error return in the lseek(2) man page.

Thanks go to Harry Schmalzbauer (freebsd@omnilan.de) for noting that
this MFC was required.
sys/ufs/ufs/ufs_vnops.c