From patchwork Fri Jun 14 10:03:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13698487 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 7F562C27C6E for ; Fri, 14 Jun 2024 10:04:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E7E6E6B0123; Fri, 14 Jun 2024 06:03:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5CDC06B0145; Fri, 14 Jun 2024 06:03:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B83A6B00C4; Fri, 14 Jun 2024 06:03:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 7D6CD6B014B for ; Fri, 14 Jun 2024 06:03:40 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 325191C06CA for ; Fri, 14 Jun 2024 10:03:40 +0000 (UTC) X-FDA: 82229057400.20.A441FE8 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf08.hostedemail.com (Postfix) with ESMTP id 95F3D160011 for ; Fri, 14 Jun 2024 10:03:38 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=wcjp3WhV; dmarc=none; spf=none (imf08.hostedemail.com: domain of BATV+810356e9f075226878b2+7600+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+810356e9f075226878b2+7600+infradead.org+hch@bombadil.srs.infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718359416; a=rsa-sha256; cv=none; b=Xgye5hl+V0AwHHGDSWckQUOpMBEZ9/P2blbqRGfl2h10CG3vaRHPr7cNGvbShQqscJlmh7 TLzd3ouaT0rEeTZ36TJ8aAuOp4IISw+8pIZTgGAQbXd/3Dtk+GVJwvKR9CyEHcA2FTdFGj lgz6ddwNBCyMN0MzS9JqPm4QncYJi/c= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=wcjp3WhV; dmarc=none; spf=none (imf08.hostedemail.com: domain of BATV+810356e9f075226878b2+7600+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+810356e9f075226878b2+7600+infradead.org+hch@bombadil.srs.infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718359416; 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=FStQe0rOw4ovI+CUc36E/SQiQptY2BV5r14yvxvD/o8=; b=7Ljn9iuVFWomOwtx3sKIvdX7Ic9fGvLdIn1u3cbr4xf6AnbmV+oVbQa4PGejhQhFUG9y/a biO42xEoKyWNXAFY3iwfoiK6u5Wl8MmZiLGvH24xpmuHuK7ijcMivohHGbMO10D6gGoO21 H++IIQQIvPkUafCA6tjRq4xvpqEqK48= 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=FStQe0rOw4ovI+CUc36E/SQiQptY2BV5r14yvxvD/o8=; b=wcjp3WhVk78M5sPQVxfA8WojUN z48Q4IpxtprJCyho9D71S9CReioWmnl7v2h9kyQHZXyrSHYnjIMFgmLnRFH3uMV+hX3fpZRyZ2f+7 kuKBR7gBriGaMAshc60VvfaoIFsrzU70w0OAGIy1V5HHLkuEiKHKa9Z+wlK1WpyNSIQ38b+IWR2Cl QdIG6+n6UgZWfquOXvYUL7xE1zgUToJula4U1pipmEwOhGlHWnHudJ1Y4x5FVuzf6VD9Kt6L8z9NQ oaT1kgD+PPdK5cPbdXJ5UAQjxigbvjCgZEb5Ra6lf16c21CxneLxOfRLBdcUZDdzKQIeaUNrFm9K1 FYbNi2uQ==; Received: from 2a02-8389-2341-5b80-6543-87c9-27d1-cd7c.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:6543:87c9:27d1:cd7c] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1sI3mQ-00000002Kh1-1Wya; Fri, 14 Jun 2024 10:03:34 +0000 From: Christoph Hellwig To: Trond Myklebust , Anna Schumaker Cc: Steve French , Andrew Morton , linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH] nfs: fix nfs_swap_rw for large-folio swap Date: Fri, 14 Jun 2024 12:03:25 +0200 Message-ID: <20240614100329.1203579-2-hch@lst.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240614100329.1203579-1-hch@lst.de> References: <20240614100329.1203579-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: 95F3D160011 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: kiwnf9pa854if37b8qyhk93635zmoqhx X-HE-Tag: 1718359418-464766 X-HE-Meta: U2FsdGVkX18sV9zi74L05BHyiktXCK+HsWKXGNDkhSYdTW6a1OXzs3m4Qq1DuIElDmOh3rvzbXus16wDYk0qabuYtXPPiu8r7L+WOzmwQdeVCWn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0XQ44fK57BFpdGym7V/RXfOlwICI58Wmqkqaw6A5g3Hr+HzuLPh55061O2kYs0N7mFiOqkzWQsQ5s/InE9xJ4Skkpo9jpn8fdwPYRZ83bFD2fqA/RtQYjId4PV2jFhM33y6/Mp7e1X8syaMy7zHtRiO21RqveguDxR8ac3Epoz6XZ+W/GUn4L4lMRY1YWSycKBKh8IGIyu8IRm0qd3qEGhYAy+5TZh8FAc/Vsg+zprxZdkgBUXODYkpLGuMvuzTrUtD2ZHhXhoDOXjNxbefkBwJYAyeK647V8lJBf9EZ9WTwqcHp3L4W4JQ== 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: As of Linux 6.10-rc the MM can swap out larger than page size chunks. NFS has all code ready to handle this, but has a VM_BUG_ON that triggers when this happens. Simply remove the VM_BUG_ON to fix this use case. Signed-off-by: Christoph Hellwig Reviewed-by: Jeff Layton --- fs/nfs/direct.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index bb2f583eb28bf1..90079ca134dd3c 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c @@ -141,8 +141,6 @@ int nfs_swap_rw(struct kiocb *iocb, struct iov_iter *iter) { ssize_t ret; - VM_BUG_ON(iov_iter_count(iter) != PAGE_SIZE); - if (iov_iter_rw(iter) == READ) ret = nfs_file_direct_read(iocb, iter, true); else