From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BEDF43D79 for ; Sun, 3 Dec 2023 12:51:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="H+ajR8b0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 177C4C433C7; Sun, 3 Dec 2023 12:51:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1701607863; bh=oHs2kPX8HK61BU/agLFwHI1VdA9cb1kPVEY9Y8fNauY=; h=Subject:To:Cc:From:Date:From; b=H+ajR8b0D2d3Zg2VBu8Jdwk+8ybcpn6obep2CsMpK4ieGbLWcRImlA016Mp8r6XnT qWNgX/JfMuaE/YAJdN89ye4HcQ9rppZoKNG8BSvJ1xbAq4BQLJAbewUVQysGO5/WWu VCifMr7tALFB/s5/pkC898szKJqwCkPx185VlCaY= Subject: FAILED: patch "[PATCH] cifs: Fix FALLOC_FL_INSERT_RANGE by setting i_size after EOF" failed to apply to 5.15-stable tree To: dhowells@redhat.com,jlayton@kernel.org,nspmangalore@gmail.com,pc@manguebit.com,rohiths.msft@gmail.com,stfrench@microsoft.com Cc: From: Date: Sun, 03 Dec 2023 13:50:55 +0100 Message-ID: <2023120354-regulate-encourage-cb36@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD git cherry-pick -x 88010155f02b2c3b03c71609ba6ceeb457ece095 # git commit -s git send-email --to '' --in-reply-to '2023120354-regulate-encourage-cb36@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^.. Possible dependencies: 88010155f02b ("cifs: Fix FALLOC_FL_INSERT_RANGE by setting i_size after EOF moved") thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 88010155f02b2c3b03c71609ba6ceeb457ece095 Mon Sep 17 00:00:00 2001 From: David Howells Date: Wed, 29 Nov 2023 16:56:18 +0000 Subject: [PATCH] cifs: Fix FALLOC_FL_INSERT_RANGE by setting i_size after EOF moved Fix the cifs filesystem implementations of FALLOC_FL_INSERT_RANGE, in smb3_insert_range(), to set i_size after extending the file on the server and before we do the copy to open the gap (as we don't clean up the EOF marker if the copy fails). Fixes: 7fe6fe95b936 ("cifs: add FALLOC_FL_INSERT_RANGE support") Cc: stable@vger.kernel.org Signed-off-by: David Howells Acked-by: Paulo Alcantara cc: Shyam Prasad N cc: Rohith Surabattula cc: Jeff Layton cc: linux-cifs@vger.kernel.org cc: linux-mm@kvack.org Signed-off-by: Steve French diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c index f1b0b2b11ab2..45931115f475 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -3745,6 +3745,9 @@ static long smb3_insert_range(struct file *file, struct cifs_tcon *tcon, if (rc < 0) goto out_2; + truncate_setsize(inode, old_eof + len); + fscache_resize_cookie(cifs_inode_cookie(inode), i_size_read(inode)); + rc = smb2_copychunk_range(xid, cfile, cfile, off, count, off + len); if (rc < 0) goto out_2;