]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Lock the vnode before calling ufs_bmap_seekdata().
authorrmacklem <rmacklem@FreeBSD.org>
Sat, 27 Jul 2019 01:52:34 +0000 (01:52 +0000)
committerrmacklem <rmacklem@FreeBSD.org>
Sat, 27 Jul 2019 01:52:34 +0000 (01:52 +0000)
commit577fca0e204db95403a12794858f47a2f799b9c6
tree718c8fe25251361023263193391050c2416cac30
parent4faa65ba2435859e1b796506735383068ea5c48f
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.

Discussed with: markj
Reviewed by: kib
sys/ufs/ufs/ufs_vnops.c