Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp488764rdd; Tue, 9 Jan 2024 10:04:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IF0vbesS0Ovj2QR7RTPp91Iouvw42D5NBfqZ61P0MPmn4Z2J2KDV8RtUMwRFwRQCmYUJy2Q X-Received: by 2002:a17:907:2cd8:b0:a2a:66df:c476 with SMTP id hg24-20020a1709072cd800b00a2a66dfc476mr503522ejc.225.1704823461478; Tue, 09 Jan 2024 10:04:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704823461; cv=none; d=google.com; s=arc-20160816; b=et4Jn51nDh1ZBd7v2CgTCVW87rP3is1xyWYzVN2bjtrxvIdRFToxCY7G/Ip9N7Qv5y JGOhsmk4RR2GbC0OV/1iT/4EQAEMu66X9/C7K/50yus+pjFNewBaUlgkxFda6j9KWR4Z 0SgAJ3SJ45pbmE987Bqzw5B/g9GDtEoI8gtWdvzVAFsEewfyJbToMZi+5aA5IKwiEa3d FFiaak6+WXhIP139FWPcylJV/gir6r/4eFmw6QCbzK5Jo9Tygg3sr5SuQUQg6DwsHxrp jkIPx24sHkVntqAuh6LJHxKRU6Nxd6SmL7SyYKIKOnt+himRLNsvo3DfOSyjOuSyXeIn RrIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=htZaU1/QSRuOWh3B5AYLSVZDvmENK74hhmVyyviJXCk=; fh=7FeHu9l3h/LcPrN6dirNTNfvY8z6bMb/mXIEfzedng8=; b=wKIDR9nvJIP6hOYi/8B5zFZYzBnn2pWAo+ubBMq0SKfQNq0dwj3fM6r9HMh1TeTWzV D0caDopwBKb1HeydR4iLkhtgfXAX0lf2rA8mxXMEtCCL86ErLWXsL6wzZhSiBGh3Wuj+ QXZ8Pne/OqlxSEqECHlBQvzekoklL8b6eWcyzR0DNSAgTsVd3OJRxG57XP3pxxCxXkpa x7I0dN9O2oUvwdYwnytjJWJuCHMRjgbkl4tJ8YPvFhugtAYiZyCrkSfD8T/J4ZQVMFxC Y5n1YXEMsASwh0jDjwnMZbTknS+0MQ2gbuBnpABbKPemohR+ujwuIeOYQsp7983mkwC4 sRPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="O/GPhNqR"; spf=pass (google.com: domain of linux-nfs+bounces-997-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-nfs+bounces-997-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id h24-20020a170906719800b00a28a9e27f6asi992609ejk.536.2024.01.09.10.04.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 10:04:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-997-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="O/GPhNqR"; spf=pass (google.com: domain of linux-nfs+bounces-997-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-nfs+bounces-997-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3AB4C1F25024 for ; Tue, 9 Jan 2024 18:04:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8CED23BB30; Tue, 9 Jan 2024 18:01:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="O/GPhNqR" X-Original-To: linux-nfs@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1005D3D96E for ; Tue, 9 Jan 2024 18:01:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704823309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=htZaU1/QSRuOWh3B5AYLSVZDvmENK74hhmVyyviJXCk=; b=O/GPhNqRbvj98EwKmEGEQdP7t6Fq/ObAHvTRNruHZeKj/nFzZoXoZLYwHEDrxqU705WF0s nI3qr9CKIjx6dAIfpIqz0p1yJMVdD8bRZS58dCgJpSJm7xTjF/RJTcqcTjjjIc8sHgKeDm itbFq+Z8kriC/LUWsu7x7oLJ6bsLBQU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-166-1HRLsJ-qPNSJzgSw3CTxDA-1; Tue, 09 Jan 2024 13:01:44 -0500 X-MC-Unique: 1HRLsJ-qPNSJzgSw3CTxDA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 01B2C85A58E; Tue, 9 Jan 2024 18:01:41 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id C01671121306; Tue, 9 Jan 2024 18:01:37 +0000 (UTC) From: David Howells To: Christian Brauner , Jeff Layton , Gao Xiang , Dominique Martinet Cc: David Howells , Steve French , Matthew Wilcox , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Eric Van Hensbergen , Ilya Dryomov , linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Steve French , Ronnie Sahlberg Subject: [PATCH 4/4] cifs: Don't use certain internal folio_*() functions Date: Tue, 9 Jan 2024 18:01:15 +0000 Message-ID: <20240109180117.1669008-5-dhowells@redhat.com> In-Reply-To: <20240109180117.1669008-1-dhowells@redhat.com> References: <20240109180117.1669008-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 Filesystems should not be using folio->index not folio_index(folio) and folio->mapping, not folio_mapping() or folio_file_mapping() in filesystem code. Change this automagically with: perl -p -i -e 's/folio_mapping[(]([^)]*)[)]/\1->mapping/g' fs/smb/client/*.c perl -p -i -e 's/folio_file_mapping[(]([^)]*)[)]/\1->mapping/g' fs/smb/client/*.c perl -p -i -e 's/folio_index[(]([^)]*)[)]/\1->index/g' fs/smb/client/*.c Reported-by: Matthew Wilcox Signed-off-by: David Howells cc: Jeff Layton cc: Steve French cc: Paulo Alcantara cc: Ronnie Sahlberg cc: Shyam Prasad N cc: Tom Talpey cc: linux-cifs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org --- fs/smb/client/file.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c index b02b7f0a47dc..253e06a7875e 100644 --- a/fs/smb/client/file.c +++ b/fs/smb/client/file.c @@ -87,7 +87,7 @@ void cifs_pages_written_back(struct inode *inode, loff_t start, unsigned int len continue; if (!folio_test_writeback(folio)) { WARN_ONCE(1, "bad %x @%llx page %lx %lx\n", - len, start, folio_index(folio), end); + len, start, folio->index, end); continue; } @@ -120,7 +120,7 @@ void cifs_pages_write_failed(struct inode *inode, loff_t start, unsigned int len continue; if (!folio_test_writeback(folio)) { WARN_ONCE(1, "bad %x @%llx page %lx %lx\n", - len, start, folio_index(folio), end); + len, start, folio->index, end); continue; } @@ -151,7 +151,7 @@ void cifs_pages_write_redirty(struct inode *inode, loff_t start, unsigned int le xas_for_each(&xas, folio, end) { if (!folio_test_writeback(folio)) { WARN_ONCE(1, "bad %x @%llx page %lx %lx\n", - len, start, folio_index(folio), end); + len, start, folio->index, end); continue; } @@ -2649,7 +2649,7 @@ static void cifs_extend_writeback(struct address_space *mapping, continue; if (xa_is_value(folio)) break; - if (folio_index(folio) != index) + if (folio->index != index) break; if (!folio_try_get_rcu(folio)) { xas_reset(&xas); @@ -2899,7 +2899,7 @@ static int cifs_writepages_region(struct address_space *mapping, goto skip_write; } - if (folio_mapping(folio) != mapping || + if (folio->mapping != mapping || !folio_test_dirty(folio)) { start += folio_size(folio); folio_unlock(folio);