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 38C8FC38A29 for ; Tue, 14 Apr 2020 14:09:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1890120578 for ; Tue, 14 Apr 2020 14:09:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586873394; bh=NWWGYY19cTRR3fqYBi0Y2XeIDzR3VsRhdPZWTBieaFI=; h=Subject:To:Cc:From:Date:List-ID:From; b=gpQBO7halqyQRjXwfTwH+1u3VwJMadSt5ZTkc5MItDqHGSUGJQY/9C/dK9vvNdfw8 NEiiA2j18q9e8uLWdYW6GvXHs4UQ+QpG3kcYELuSh4R48u8nqU/UwC0gUaxSfHbSgw Eb6ZlihwVfnjJh539GfCgZbCTCWHt6n0DDpz6nmE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389175AbgDNOJw (ORCPT ); Tue, 14 Apr 2020 10:09:52 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:43011 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389201AbgDNOJv (ORCPT ); Tue, 14 Apr 2020 10:09:51 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4FA165C0216; Tue, 14 Apr 2020 10:09:50 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 14 Apr 2020 10:09:50 -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=ER4qRf prpqUe699n+GZPIUrt4Kim+7UllKDVnA+VMlI=; b=2YWDLwuCjHpslrs6UqBULB JU94b9lvi9S0ZF1vo/EFN0vJua2U6oCpt5mJACXwIhJK/NZ7v+EMYRZHrQW3LZO/ OE5TKYe0YlPeuwXMJUI5QmQ84rnE2RbChtek6C9AcqubujYY4eSoNzn3SrmcoeIb 6c+DFaBRTNSGba9LYev9sd9npxUZ+dnQxb/nYFVTNlh4tKTjSKUQ8/u/75/rSWDJ BX6Uyri+a7JOBfAtNJhzUVvdkiKYTFxcTgFQB+VU+Hml7INKxg1H2ZcjV0QrtaL4 uSkV3YVqWHLVuEujVToie6s1taBqzOTf9EtJctjQQGTvCTa4O9qJ7JRIyr1Ivohg == 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 E3687328006B; Tue, 14 Apr 2020 10:09:49 -0400 (EDT) Subject: FAILED: patch "[PATCH] CIFS: check new file size when extending file by fallocate" failed to apply to 5.4-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: <15868733793359@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 5.4-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);