Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2153903ybm; Thu, 23 May 2019 12:14:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxC2BAQoMFrfMGhWS24uqDcOQw61F7uh8zMhyBr30ufZCT+3KMsfp+pDP3jH4Pq9RX1vFhG X-Received: by 2002:a17:902:3283:: with SMTP id z3mr74255088plb.278.1558638891583; Thu, 23 May 2019 12:14:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558638891; cv=none; d=google.com; s=arc-20160816; b=snxU35K84m39W/cHLbr4YHDXXiMyDQRY+6xPk7vAj3CGt7bdQRAtvNtrTrsGWeG+u5 uvQc7/YV8EjpWVvLx4D1G/GZoRpe1BcS5ZHAsYJ4oZwjlvZmNQUboiHmHdKUoRm+pg8L wfHfMJZOYtQ0p+YcqKGnITAnilGFWuj1qUoMNy4XXr+gKfhJP7vam9ehCxzGwSs7WvGK uYNTpTwXBulxrtml2EJ/nTsiROgXr11QsofcqGqIkTL/j64pOTN4PVD2TSJ9WEuuPH1A FevEYWCHfdTr0E6QiSnDWLlh1bIIKOnr+KvKUtXF7nyjI+je3UYseOG9RAB4GF1huG8o VIbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6PCU3OHKeKwQjeAd53SMi+f7bkO7F1T9njH4ab/HG3U=; b=vQBg074Bc3VvZrkD6Iz/0wbTHn+87a28nPKAafWZol2x+n50yjbjdTiNCz3K61Pc+u 1/HLF8QE8uSyo/rdJcRiApvp7Ye9p6MsmiIyHHcJwLWA4anorrObu03xn0oDE+3LHtQk MZoaFJ8l0WHPXH+9VUENKD/i/ASee788lhlecyeyk6yyGeneXrt0j72EQj9finS08jgg K/DAiwG9tdoxHhBc5qyK2f+AjObhetHyNtGN5pmERrhZGxU4dtXQw0j5zz1ScJc0pQbc HaW3G/GRcGkAvLQ250UIJJhjE179mt8SK3XkLUS/PQykH07h/KAXrMGSXXb26s3Hx+LF jUvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=itp9kKQA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u133si357138pfc.72.2019.05.23.12.14.36; Thu, 23 May 2019 12:14:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=itp9kKQA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388218AbfEWTLe (ORCPT + 99 others); Thu, 23 May 2019 15:11:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:44954 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388190AbfEWTLb (ORCPT ); Thu, 23 May 2019 15:11:31 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C957C2133D; Thu, 23 May 2019 19:11:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558638691; bh=+1IZQUrfGfQnqIsSCy0XTRlbk6xEN7G2HIDr6wTwctg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=itp9kKQAaBfz48GR7snsScRsHu9YvzJ0Qvy+6+DOEhe+Np6wntVOk/kixTc9vj2Wl LXZ3AKAxqXti41AcxXADMok6KOHc/76A/FWNagaX4DhcHMJ9fa6p+QNlwRveGtL0bL 6BJH8Sk/hDFGymvyWre2hDIZOasmGAhaOh8xSius= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liu Bo , Miklos Szeredi Subject: [PATCH 4.14 29/77] fuse: honor RLIMIT_FSIZE in fuse_file_fallocate Date: Thu, 23 May 2019 21:05:47 +0200 Message-Id: <20190523181724.243047686@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523181719.982121681@linuxfoundation.org> References: <20190523181719.982121681@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Liu Bo commit 0cbade024ba501313da3b7e5dd2a188a6bc491b5 upstream. fstests generic/228 reported this failure that fuse fallocate does not honor what 'ulimit -f' has set. This adds the necessary inode_newsize_ok() check. Signed-off-by: Liu Bo Fixes: 05ba1f082300 ("fuse: add FALLOCATE operation") Cc: # v3.5 Signed-off-by: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman --- fs/fuse/file.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -2974,6 +2974,13 @@ static long fuse_file_fallocate(struct f } } + if (!(mode & FALLOC_FL_KEEP_SIZE) && + offset + length > i_size_read(inode)) { + err = inode_newsize_ok(inode, offset + length); + if (err) + return err; + } + if (!(mode & FALLOC_FL_KEEP_SIZE)) set_bit(FUSE_I_SIZE_UNSTABLE, &fi->state);