* SMB3: allowing extending size if allocating on non-sparse file
@ 2019-04-22 21:52 Steve French
0 siblings, 0 replies; only message in thread
From: Steve French @ 2019-04-22 21:52 UTC (permalink / raw)
To: CIFS
[-- Attachment #1: Type: text/plain, Size: 75 bytes --]
This is simply the same as changing the end of file.
--
Thanks,
Steve
[-- Attachment #2: 0001-SMB3-allowing-extending-size-if-allocating-on-non-sp.patch --]
[-- Type: text/x-patch, Size: 1209 bytes --]
From 8f665199fa702988c627662f7673a11ef7e3c71b Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Mon, 22 Apr 2019 16:37:42 -0500
Subject: [PATCH] SMB3: allowing extending size if allocating on non-sparse
file
This is simply the same as changing the end of file.
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
---
fs/cifs/smb2ops.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index c3480a976660..f8cfcba797f3 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -2920,9 +2920,12 @@ static long smb3_simple_falloc(struct file *file, struct cifs_tcon *tcon,
else if (i_size_read(inode) >= off + len)
/* not extending file and already not sparse */
rc = 0;
- /* BB: in future add else clause to extend file */
- else
- rc = -EOPNOTSUPP;
+ else {
+ __le64 length = cpu_to_le64(off+len);
+
+ rc = SMB2_set_eof(xid, tcon, cfile->fid.persistent_fid,
+ cfile->fid.volatile_fid, cfile->pid, &length);
+ }
if (rc)
trace_smb3_falloc_err(xid, cfile->fid.persistent_fid,
tcon->tid, tcon->ses->Suid, off, len, rc);
--
2.17.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-04-22 21:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-22 21:52 SMB3: allowing extending size if allocating on non-sparse file Steve French
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).