vfs: fix rangelock range in vn_rdwr() for IO_APPEND
vn_rdwr() must lock the entire file range for IO_APPEND just like vn_io_fault() does for O_APPEND. Reviewed by: kib, imp, mckusick Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D28008
This commit is contained in:
parent
79eca6520e
commit
11403bdeb4
@ -584,6 +584,8 @@ vn_rdwr(enum uio_rw rw, struct vnode *vp, void *base, int len, off_t offset,
|
||||
if (rw == UIO_READ) {
|
||||
rl_cookie = vn_rangelock_rlock(vp, offset,
|
||||
offset + len);
|
||||
} else if ((ioflg & IO_APPEND) != 0) {
|
||||
rl_cookie = vn_rangelock_wlock(vp, 0, OFF_MAX);
|
||||
} else {
|
||||
rl_cookie = vn_rangelock_wlock(vp, offset,
|
||||
offset + len);
|
||||
|
Loading…
Reference in New Issue
Block a user