Remove the nm_mtx mutex locking from the test for
nm_maxfilesize. This value rarely, if ever, changes and the nm_mtx mutex is locked/unlocked earlier in the function, which should be sufficient to avoid getting a stale cached value for it. There is a discussion w.r.t. what these tests should be, but I've left them basically the same as the regular NFS client for now. Suggested by: pjd MFC after: 2 weeks
This commit is contained in:
parent
a6d81a941f
commit
02541adb4e
@ -946,12 +946,8 @@ flush_and_restart:
|
||||
if (uio->uio_offset < 0)
|
||||
return (EINVAL);
|
||||
tmp_off = uio->uio_offset + uio->uio_resid;
|
||||
mtx_lock(&nmp->nm_mtx);
|
||||
if (tmp_off > nmp->nm_maxfilesize || tmp_off < uio->uio_offset) {
|
||||
mtx_unlock(&nmp->nm_mtx);
|
||||
if (tmp_off > nmp->nm_maxfilesize || tmp_off < uio->uio_offset)
|
||||
return (EFBIG);
|
||||
}
|
||||
mtx_unlock(&nmp->nm_mtx);
|
||||
if (uio->uio_resid == 0)
|
||||
return (0);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user