Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F105760905
D33422.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D33422.diff
View Options
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c
--- a/sys/fs/nfsclient/nfs_clvnops.c
+++ b/sys/fs/nfsclient/nfs_clvnops.c
@@ -3761,6 +3761,7 @@
off_t alen;
int attrflag, error, ret;
struct timespec ts;
+ struct uio io;
attrflag = 0;
nmp = VFSTONFS(vp->v_mount);
@@ -3769,18 +3770,24 @@
if (NFSHASNFSV4(nmp) && nmp->nm_minorvers >= NFSV42_MINORVERSION &&
(nmp->nm_privflag & NFSMNTP_NOALLOCATE) == 0) {
mtx_unlock(&nmp->nm_mtx);
+ alen = *ap->a_len;
+ if ((uint64_t)alen > nfs_maxalloclen)
+ alen = nfs_maxalloclen;
+
+ /* Check the file size limit. */
+ io.uio_offset = *ap->a_offset;
+ io.uio_resid = alen;
+ error = vn_rlimit_fsize(vp, &io, td);
+
/*
* Flush first to ensure that the allocate adds to the
* file's allocation on the server.
*/
- error = ncl_flush(vp, MNT_WAIT, td, 1, 0);
- if (error == 0) {
- alen = *ap->a_len;
- if ((uint64_t)alen > nfs_maxalloclen)
- alen = nfs_maxalloclen;
+ if (error == 0)
+ error = ncl_flush(vp, MNT_WAIT, td, 1, 0);
+ if (error == 0)
error = nfsrpc_allocate(vp, *ap->a_offset, alen,
&nfsva, &attrflag, ap->a_cred, td, NULL);
- }
if (error == 0) {
*ap->a_offset += alen;
*ap->a_len -= alen;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 7:31 AM (12 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15539134
Default Alt Text
D33422.diff (1 KB)
Attached To
Mode
D33422: add a check for filesize rlimit to nfs_allocate
Attached
Detach File
Event Timeline
Log In to Comment