From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25FA3C2BA19 for ; Tue, 14 Apr 2020 14:09:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 01E1F20578 for ; Tue, 14 Apr 2020 14:09:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586873393; bh=HuxwupZQVUdYte4Ay38qvrLgpT3vUwo7UKnBXFBvGBk=; h=Subject:To:Cc:From:Date:List-ID:From; b=InldibXoBL9NmtSfu+RwUri9JLQAUyezehDBx9igmOKpecKrW8EJkg1LzOjoxQgtU q8NmWuG/YYGv3DefhsshBoW6Fghns8/Gi6/dzV7BlfE5m32hihDZiJ5KKJpcrz7J8/ 82KHfnSvSGuqsKmDElNEK6mqmZgDXsaLExiApiYg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389203AbgDNOJw (ORCPT ); Tue, 14 Apr 2020 10:09:52 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:33953 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389175AbgDNOJu (ORCPT ); Tue, 14 Apr 2020 10:09:50 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 0AC885C0263; Tue, 14 Apr 2020 10:09:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 14 Apr 2020 10:09:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=ZNW7LH 6Lji3w0tbksuy3DwsDemfECagSzUSouKc5gNU=; b=auHaEce6jC2BAxuno3ESu6 n5G8xLe3ytx9kgnYszAzJaB1N13D85ssat9F3ZzsLmxgylj6TOpqHnGKfoIlJRAT a8BD7mu+k6ls0ODCadNcxf3lv0ZcoCYLEvwGrO/cQa2SoRwu8fGF776jD5nElpJG eJZqbQNU2iaqq+kBi5kNAMf1yMFDmH2G7LsveHoyJhACV8dw5IRNfh9p2oXgFMLx MRx2JKCFyHZpwr+nt5KDVYopnQFyyRYUM6lFrWLIt7+B+RW1igN+onav8fgj1h5M EiLh+ZCQ3/sY/taUn6oLlbw8J4cb0bkVc27PDxsowizDuOHB8DT2PTMcqix0yZpQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrfedugdejvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertddttd flnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhg qeenucfkphepkeefrdekiedrkeelrddutdejnecuvehluhhsthgvrhfuihiivgepudenuc frrghrrghmpehmrghilhhfrhhomhepghhrvghgsehkrhhorghhrdgtohhm X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 7DD743280066; Tue, 14 Apr 2020 10:09:48 -0400 (EDT) Subject: FAILED: patch "[PATCH] CIFS: check new file size when extending file by fallocate" failed to apply to 4.19-stable tree To: jencce.kernel@gmail.com, lsahlber@redhat.com, stable@vger.kernel.org, stfrench@microsoft.com Cc: From: Date: Tue, 14 Apr 2020 16:09:39 +0200 Message-ID: <1586873379150133@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 4.19-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 . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From ef4a632ccc1c7d3fb71a5baae85b79af08b7f94b Mon Sep 17 00:00:00 2001 From: Murphy Zhou Date: Wed, 18 Mar 2020 20:43:38 +0800 Subject: [PATCH] CIFS: check new file size when extending file by fallocate xfstests generic/228 checks if fallocate respect RLIMIT_FSIZE. After fallocate mode 0 extending enabled, we can hit this failure. Fix this by check the new file size with vfs helper, return error if file size is larger then RLIMIT_FSIZE(ulimit -f). This patch has been tested by LTP/xfstests aginst samba and Windows server. Acked-by: Ronnie Sahlberg Signed-off-by: Murphy Zhou Signed-off-by: Steve French CC: Stable diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index b0759c8aa6f5..9c9258fc8756 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -3255,6 +3255,10 @@ static long smb3_simple_falloc(struct file *file, struct cifs_tcon *tcon, * Extending the file */ if ((keep_size == false) && i_size_read(inode) < off + len) { + rc = inode_newsize_ok(inode, off + len); + if (rc) + goto out; + if ((cifsi->cifsAttrs & FILE_ATTRIBUTE_SPARSE_FILE) == 0) smb2_set_sparse(xid, tcon, cfile, inode, false);