HomeFreeBSD

ffs_close_ea: do not relock vnode under lock_ea

Description

ffs_close_ea: do not relock vnode under lock_ea

ffs_lock_ea is after the vnode lock, so vnode must not be relocked under
lock_ea. Move ffs_truncate() call in ffs_close_ea() after the lock_ea is
dropped, and only truncate to length zero, since this is the only mode
supported by ffs_truncate() for EAs. Previously code did truncation and
then write.

Zero the part of the ext area that is unused, if truncation is due but not
done because ea area is not zero-length.

Reviewed by: mckusick
Tested by: pho
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

Details

Provenance
kibAuthored on Feb 21 2021, 10:10 AM
Parents
rGc6d68ca842a3: ffs_vnops.c: style
Branches
Unknown
Tags
Unknown