From patchwork Tue Jan 9 18:01:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13515194 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 24180C4707B for ; Tue, 9 Jan 2024 18:02:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 03BC66B0099; Tue, 9 Jan 2024 13:02:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EDED28D0001; Tue, 9 Jan 2024 13:01:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D30896B009B; Tue, 9 Jan 2024 13:01:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id C302D6B0099 for ; Tue, 9 Jan 2024 13:01:59 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 6CD42A1DE4 for ; Tue, 9 Jan 2024 18:01:49 +0000 (UTC) X-FDA: 81660540738.09.D3FECA6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf10.hostedemail.com (Postfix) with ESMTP id 2B8BAC0035 for ; Tue, 9 Jan 2024 18:01:45 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=BcRHj73F; spf=pass (imf10.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704823306; a=rsa-sha256; cv=none; b=DuDp/STY0aQZPNactZXiaYdOne0a/YF2Oytr2r8mQOlrX0QGE1kXqnuqMz84UFL/fDgKt7 EVkNbsMFsHBd4aDICa/x/TK9z5g/H5EVA6JJvh+XwL638bzfbXmn/AihHGwqq9393pclEX 8M2se8Rk5Batl7MtUf3D+OUD6hrfAww= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=BcRHj73F; spf=pass (imf10.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704823306; 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=htZaU1/QSRuOWh3B5AYLSVZDvmENK74hhmVyyviJXCk=; b=BU/qgepFPISX8NcM/j5ObypbO2dYc5gWHnrk7T95ypDVGPJOuYhPcZJ+bSoPUZFnggNbFc CXbPgBSxTpjH6CZKw+WGTGKqSmkXqT04mAjE4t4BUxds6dYouX8dp79j3Mx3boZhkI6Mey aLfux3B2PD1ao5vlKqCkNFb7nb9WYlY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704823305; 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=BcRHj73FP96v8+KuWZX8TT+HVxMQwBnp0g6HTXjQY+oz6hsjlKTdc3zehMnh5uk/clWUSj igKUQJsTPaZryR4peMj0TK8KSVheItD8r87SEMwH1lWaM/Yd73/i7PF3/D0lBXu0JO0JWZ xeNwH3n70JPzST96Xy0F9LzyRbG90E0= 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> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 2B8BAC0035 X-Stat-Signature: tbazio95rhmkbya7653grshnoxpedoby X-Rspam-User: X-HE-Tag: 1704823305-681423 X-HE-Meta: U2FsdGVkX188p6SiImyWHFZunPFMdMmZdzC3cQz1RTzILgwr58Mtup9YQkcytrvoks8Sh5MORF4YHZGOLq/W8lYw3WDMGa6spfMoxMC59+jaPC01NeC1/qbyOA8Rg2I+T8shiuRBQCLBP9ttsfR2davK6DcB0qcBYZyxAZZ+jKm9doytOfJIh8FVFBnv49CM3mkA74C7Zc+sFCHCSnw1bjccGY/xg3uPpDaUXeRrRJNGVAGl6oGJSFKFyf69WiCtD1Nvuz9y6QILNd7jZX5RSwNMTFIG50VUUlKjh3owBBPqE25NjBvRkLNTuixrzSNgRTMj+4PYuwglA2+cvwe01wD94P/yltNx3L/DudZur/J5RWQkC2eYwtZvmgEYayGhPyVNNictwVZIn1zRX3D7r+3C8UndajsSb4hFYew3229nlUAf/fYdYmmvUVnh42Ug2d6QanlBtsa5l44lOi0lRwH9dlsydPEzmJGW3QFJCyVaBcTtFSXD2p69RjFx9B+evxMYOzHNUmB3yvOtJob0BbpHCN1Lm/FoYcawFhpLEi+lsoas8t57B8hEoKoYoSFqP6P3JMZNXf1JX2/770rWMH8x5mpHxWJR8KD9u8Dn3qPBmQE5G453Rc/XqOclK08MlkkELp1yHCfvg66vnPQ5FwTy9MQ9FMMJFbQ3o5WLm7yuohMwyT8rcSjGXs18cTjT4BZtzdrq5NrwSWSvTPxukHz4cWpi2kK1dZZKnrOOcFwxr9qTpbpAwtpReyul2o4XF/6LN7GY/kDd4YGtgf+IRmKuGXDemy97THJ2EG06eoDNEo6mxtMsy45y972PLWuD3up6nFvQ10jx9imspWY3o5I0XiKqlHSCCxNJyq7IHm3cj7cF8+7lUFJOKOlpsbqDhB593w5P/XkUGRhF4YrOCZv/WSrG+mBsvdNNEv+JeGg2pssAj6wJAy0n8B32DvTUzCL8iGMlZpJQAIfbFEJ pdYMgCGG eSpsg5au3RPb7JnfJGdMjw8byJsuru+f98l9vmwb+I6oTFoIp7qakXY+rF/7/4BovRO9flvfwkpgIbTVnbYgWChr1dGKVxRZnzzRhhCeNkGNJJ3PWYI0UEyepyN3KkO3vpRZkH72d/frqq5fvJtzVncOGvM9nE9fl1/UmUdPyjgLCXhZgw6Ok637SnKeALjG9rVo67n89s/X1JujaLy/V4nXfzqVWUpnZ8Ir/9tCnzSMONblA3w8N1w8vs+qOetWHdnjD3LRaDToUijmIjFbLj+C11X6SSlx2PaapQ/jd9+kMCnYpyKHTqHaOFwaDyJnIPnDFF49laMWooJwZCcLhvZPXBznjz2b/haiU0vtvwraVmgFslREn1ifqLO1DpoQmRTTCFbXRKQB3KFG+iB96883mTv7TwRvUvcHapn1YWRrbr+nf8rUpBbSdbzHuF7QY+Iu37DJJlHN4pqxqzZTlnKgyqe4HQ/bskgpclrNb8vY5zfoc//9WbvoFxS1GUasuN9Ktpl9QQIhhO0bTl9VF661j/LxaBahxGbLh 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: 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);