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

Provenance
rmacklemAuthored on Jul 27 2019, 1:52 AM
Parents
rG776d3d592474: virtio: Fix running on machines with memory above 0xffffffff
Branches
Unknown
Tags
Unknown

Event Timeline