HomeFreeBSD

Lock the vnode before calling ufs_bmap_seekdata().

Description

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

Details

Committed
rmacklemJul 27 2019, 1:52 AM
Parents
rS350366: MFC r349802 (from fsu@):
Branches
Unknown
Tags
Unknown