From patchwork Mon Feb 19 06:27:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13562210 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29D26C48BC3 for ; Mon, 19 Feb 2024 06:27:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5A8178D000D; Mon, 19 Feb 2024 01:27:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 530E78D0008; Mon, 19 Feb 2024 01:27:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 384AF8D000D; Mon, 19 Feb 2024 01:27:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 0B70F8D0008 for ; Mon, 19 Feb 2024 01:27:49 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id DBC6F1A01FE for ; Mon, 19 Feb 2024 06:27:48 +0000 (UTC) X-FDA: 81807572616.23.A4D73EE Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf04.hostedemail.com (Postfix) with ESMTP id 481BC4000B for ; Mon, 19 Feb 2024 06:27:47 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=JbpnhUX6; spf=none (imf04.hostedemail.com: domain of BATV+994827af29a55d2021e7+7484+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+994827af29a55d2021e7+7484+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708324067; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ftDKzMVuY3mh1JqnX/Rx8Xv83eufPBpMko9jspRah50=; b=dM1G0Lt+z+Q0xyZJUyFApfbwRsbpLEFvBxIqS+ZIPDgmRYVnvBMNb9UenrhKwP7iK3okNZ uqDRKrgPUdVf/9woOnIAbkxJnASMCcsrvRE7wdKq6I/4fomN4T2fGkEXfXWz7T4qbBvqrf +aMrtRlWtmzOiK6534hvYI0KxaOw7zo= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=JbpnhUX6; spf=none (imf04.hostedemail.com: domain of BATV+994827af29a55d2021e7+7484+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+994827af29a55d2021e7+7484+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708324067; a=rsa-sha256; cv=none; b=OkMq6/nc0AS8/2AsVLDtx7/27lGT4N7GjIgwOwIr3NDdQYwSPbnG8nj7N3255TGjSCtGYf JILsjcwE0h88UdXJPnGuSCIhwGAW5M/I/eQahCmsuoQQ7PPrvRenvYZ2hx5Vf57C7JtUbK 8jz/NT4JJFAY6WXpRhrJ/FqHH2mApXA= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=ftDKzMVuY3mh1JqnX/Rx8Xv83eufPBpMko9jspRah50=; b=JbpnhUX69LwoqeuzXRfVNOyxr3 VLnvzgUo9Ypk0zo8238UgQ6vfICjH4vDNnQCpwQRefMvGp0uDAXGaWAHAbZC+1WEuO2a6k2fanKSd jL8+gYpKnqRlDZC5HwiGiFa3uuieJZfufrOk7SkLxxoUVAO7ELa4Y+XbY6pD5ixXJZCFD1XvZ3zAW eE47JO9lmXug91a4BwMnepqo8+BX4SIzHTNLBzIoK7bq9vylGBHYN4rOINFERo0JxIWeGdo0gd8MW 0C6GHu8TPjJd8k6U4r5Hz3Vm473yuSTPZOn9cLCnYbE0VDYyfkea/9qu6uoLdNoaLlahxrRtBLMbB 9c7rvJgg==; Received: from 2a02-8389-2341-5b80-39d3-4735-9a3c-88d8.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:39d3:4735:9a3c:88d8] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rbx7w-00000009FB3-3GK2; Mon, 19 Feb 2024 06:27:45 +0000 From: Christoph Hellwig To: Chandan Babu R , "Darrick J. Wong" , Hugh Dickins , Andrew Morton Cc: Hui Su , linux-xfs@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 08/22] xfs: use VM_NORESERVE in xfile_create Date: Mon, 19 Feb 2024 07:27:16 +0100 Message-Id: <20240219062730.3031391-9-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240219062730.3031391-1-hch@lst.de> References: <20240219062730.3031391-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspamd-Queue-Id: 481BC4000B X-Rspam-User: X-Stat-Signature: xaqqode5fi78nf6wrd3smmdmor79a6rs X-Rspamd-Server: rspam01 X-HE-Tag: 1708324067-868379 X-HE-Meta: U2FsdGVkX19hRTD3wel0augSu6lWqpZdgDpp/nk+SQoDlazL4dsIfVc8Vl6PDRIWzS6z0JFjWTldWXnkGI1OoENC0a067wRrQNw9dGcKUblylv8MgWOVr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5abVaInuCYjO/LaiJrBUw/P9vzsVyrh5+96IQ5cnOU0bJBXHnVR2EJKGcGeyWT7P6uMme3K6u4g95maavjWj0UGq0ZsV/z7xRIu+sONdmZemRwxuvJBYBHkPAkRFqkYqnkvP8fgLA24QtnPk+TBaq5AllhGlQHGgYI3QkSKxDg1MZZWD0p4DwGoksn1eeZLIGEYrAUpraVe4gG3qCkmK6lK26SbW4anpp2b6s1BVnkxAKCljTkCuDBvcDIRBr7KWxwD/rSSAzo8cB0gCpiT6gktlu0udRanc4 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: xfile_create creates a (potentially large) sparse file. Pass VM_NORESERVE to shmem_file_setup to not account for the entire file size at file creation time. Reported-by: Hugh Dickins Signed-off-by: Christoph Hellwig Reviewed-by: Dave Chinner --- fs/xfs/scrub/xfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/scrub/xfile.c b/fs/xfs/scrub/xfile.c index 090c3ead43fdf1..1cf4b239bdbbd7 100644 --- a/fs/xfs/scrub/xfile.c +++ b/fs/xfs/scrub/xfile.c @@ -68,7 +68,7 @@ xfile_create( if (!xf) return -ENOMEM; - xf->file = shmem_file_setup(description, isize, 0); + xf->file = shmem_file_setup(description, isize, VM_NORESERVE); if (!xf->file) goto out_xfile; if (IS_ERR(xf->file)) {