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 903FDC2BA19 for ; Tue, 14 Apr 2020 14:09:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6D5D520578 for ; Tue, 14 Apr 2020 14:09:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586873384; bh=LVk4ZCZfw1kKy1W39x2tZNt35Bi4hU8f4SDsEIH/ni8=; h=Subject:To:Cc:From:Date:List-ID:From; b=PeLqilH2DwsW/vCLRaLI8Iq+gElH1KXdHEJiNC0ulP7GoPySsah1D1YtAyxaHZyti GQZIalSBjnhE6KBf2PLbVQ9Z5jPG/NV1paMbOVmG8wrcHXvwpPNLocV8JtCYgNkCFE GUGAdgtheIYC6J4GNE8agiTEQNEkU7QHmhJHGA+Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389194AbgDNOJn (ORCPT ); Tue, 14 Apr 2020 10:09:43 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:51273 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389175AbgDNOJm (ORCPT ); Tue, 14 Apr 2020 10:09:42 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 0022C5C027E; Tue, 14 Apr 2020 10:09:41 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 14 Apr 2020 10:09:40 -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=XZIPC7 58dMGnrEOVmcpsR/kH/TGXEMxNqdQULBPcml8=; b=Oj4oRvR8dNc7DpfkWwmbnU lBHZqZBk4+E8N4ow1F5nBdG67uIrZ1d9r8GA+SXJgRvPO4M9hI9ahFP16Ey3J36+ a+rzH7NLSxstToipawcu89qcCAz1j5GGyMct6/570pC5LM+o8aou0dp/tWQpj/gD ze5THa5DlHC3M+Jh07k57XX0oCSEOAaODlgeYT339SlkakU5P5GijqsQf7eEFsbx 2dVH+wQyvMO9BTlqdk7cqQf3ZVC3mnSeaiDwl3k63eFiI16O1ZU+eER6hscfj8T0 6my4gUn/A2g9shM4CpzwfAVZft9S8m6P7RCIxLXn1BsmcPSNF0uXCx5v+RNkqzNA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrfedugdejvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvhfffkfggtgfgsehtkeertddttd flnecuhfhrohhmpeeoghhrvghgkhhhsehlihhnuhigfhhouhhnuggrthhiohhnrdhorhhg qeenucfkphepkeefrdekiedrkeelrddutdejnecuvehluhhsthgvrhfuihiivgeptdenuc 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 1CF58306005E; Tue, 14 Apr 2020 10:09:40 -0400 (EDT) Subject: FAILED: patch "[PATCH] CIFS: check new file size when extending file by fallocate" failed to apply to 5.5-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:38 +0200 Message-ID: <158687337815523@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.5-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);