From patchwork Mon Apr 22 21:52:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 10911677 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6CE4514DB for ; Mon, 22 Apr 2019 21:52:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56847287CC for ; Mon, 22 Apr 2019 21:52:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49B54287F4; Mon, 22 Apr 2019 21:52:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFB96287CC for ; Mon, 22 Apr 2019 21:52:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726698AbfDVVwZ (ORCPT ); Mon, 22 Apr 2019 17:52:25 -0400 Received: from mail-pf1-f171.google.com ([209.85.210.171]:44193 "EHLO mail-pf1-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726638AbfDVVwZ (ORCPT ); Mon, 22 Apr 2019 17:52:25 -0400 Received: by mail-pf1-f171.google.com with SMTP id y13so6328977pfm.11 for ; Mon, 22 Apr 2019 14:52:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=qJriqYvsCdwDwz1J4BUmS0Fj8T3kgU0ZdQ54fDVKccg=; b=mbyRb6kYnWTr1CN5VQKz+c2zhquuRy7RThvtieJrTV1ZrEUb7zUg6MLZP8aHzoOQln hR2Tdiy2RaspZNmPpuoxIff2xwjFalaj4b1nFSriLBkyKRwmA/U4YIq+CYmZd3V9W6pj UzDRwRJfR97qpcM2Xaby+MQZaTHTr3SbltyyYStI+fv6NrEd/p0vP2nTV7D4f0Ezs/TA UiqzQoBpV5Hbj7E+VahqR7lnnFxWxFPAkwNVcMf7g2EoRE21bkLIzAk2q75mxe+S4Hm9 X36j0s3QXsKuIuEHKr/o2dwhU82txtiLDgxS0TkqsySipMvDRqRJvK7ymmplNb/f8J/y VQqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=qJriqYvsCdwDwz1J4BUmS0Fj8T3kgU0ZdQ54fDVKccg=; b=HN15iQbbmeiS0GSy10KhViskIB2AiLGm6iiCVzX8zHfk9JGL7btHQFYqFz6zNhYAM6 /sOdKdboe0Xn7G8UK6Bcw8oGhqFujur9IBRSKDtiZaWiIGyywfArZkxhXaZAo5jSD5JQ xpNViZ4KqiRCwqfyayHuw3nlnqne0qFcUv8klyuYnVgsF2L6nXLTxKLPKvz2cf+vLWTL kzvbwqU1FerL4wzzcIB7QpgcEbX32AK/7WMtKR4DDOfW1t0M1lS3BQusq6wV8MygG1WC XXmXqkA2Jb1ObDjQXqC4D9B4AbtkhK8TDAY7t5vwnsE4j9rZ78E/TNLS0xZO+IMAlta5 EBpA== X-Gm-Message-State: APjAAAXQUPksFTwxFkXk+ZBgt+5MBtx/Hj6jEM0I2Hxk933jvZzYLV91 qorRDgAvYHvvnIgDwh7kytnZxHG+HLN8BNulkEbxLGMZ X-Google-Smtp-Source: APXvYqzIHNdzw3+tvYCPa9LwY0JMgk05PrBrmUY0pmYJF9g/1dkdBAyw8GfYEV49y6wWFkMTHlJQLfIqF2ppfjwfcKI= X-Received: by 2002:a63:570d:: with SMTP id l13mr21239024pgb.55.1555969944030; Mon, 22 Apr 2019 14:52:24 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Mon, 22 Apr 2019 16:52:11 -0500 Message-ID: Subject: SMB3: allowing extending size if allocating on non-sparse file To: CIFS Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is simply the same as changing the end of file. From 8f665199fa702988c627662f7673a11ef7e3c71b Mon Sep 17 00:00:00 2001 From: Steve French 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 Reviewed-by: Ronnie Sahlberg --- 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