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: 186499 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2411:b0:101:2151:f287 with SMTP id m17csp286542dyi; Tue, 9 Jan 2024 10:04:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IEqNGMpzCAH5bB+VqRR7ylRrp/+KXXZB2fDRpy6XsWCy2skpagfLu/bOh8xP6pfSGR5MIwn X-Received: by 2002:a05:6e02:1c2c:b0:360:973b:8440 with SMTP id m12-20020a056e021c2c00b00360973b8440mr1966681ilh.123.1704823475666; Tue, 09 Jan 2024 10:04:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704823475; cv=none; d=google.com; s=arc-20160816; b=YCKybZzLvxn/WofKMP5xb9cwxGJQDEsK7GQ3v5y1LQkx6dqjc1aUtbTOZJAGCGjJR5 EzFnN3gD7ZbS1GkmjxCTbasMxHGmw9A+5KiZVBlr80wJwWtEPqZjOI30nuqT5jL4fs5l 1kgm+iB38ljBN8oPqhhugbX054zYtA0Lv4vODZFvXROanKu/82MfYEPqaR9pTU8bzRml Np5j32jw7ph69sMv8/Rnz/TnAze3ckZedOT9ILFphwsgDb+X2DWFMdTs+GS3KXUZ3hHf pE/NFiEwLphY3o5ZblcPmlZqlzn4dRJz3Bp/78j1gScdkw3Y+VhjS2Zew5zJKOrQarkb HPgw== 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=k+ww9ewEoO/l2N+5zi6ybIQP0y0bZJjfJOGx8k7Lw/kyUbzShi4bLqzwFqriFzz4g+ mZYLM/W2/odxmJHir6P7XWcuW+3ARM7JfjYKVKSaT1eay7UJQ7yJLFXxFMhkfLWoFIKN E73Go/VcMAKS+GMjogsC059JmlGwcN+cjOmJohC5bnPpKjJkYF3P1y9+i3ExODtr8vlU L58eP+dw9dNC3YiZZTE61UDsAXKxUsS5nZsHQkosUESxej4IKSoxrQMJJBTLzg0sNqbj SaU0BBAvRhhGOohCYAWx2q07943CC3gHHB5lSwDHuXUlwefh21gVUMIkUgOYilnVSC+g R3Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=a4VOwkqX; spf=pass (google.com: domain of linux-kernel+bounces-21210-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21210-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id n5-20020a1fd605000000b004b72e11e8dcsi465959vkg.187.2024.01.09.10.04.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 10:04:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21210-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=a4VOwkqX; spf=pass (google.com: domain of linux-kernel+bounces-21210-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21210-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4C8C81C248FC for ; Tue, 9 Jan 2024 18:04:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 09F373DB97; Tue, 9 Jan 2024 18:01:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="a4VOwkqX" 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 11AD43D99C for ; Tue, 9 Jan 2024 18:01:51 +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=1704823311; 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=a4VOwkqXi+8jcEzaOBtVXtsenYC5zeQtPA8ncnUcZo8SzMO7FD9PaO+RdRR/Rx0Znc0eWU XSJJ3Q8jb45ewUokxLLntZIzBWFUqMWORxCuLVptBDS9/hzp/m8FVSfyNSrECWaey2kK0z 6JD49UjDqaxFWo3R309MX3kj+YwY45U= 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787636980441227942 X-GMAIL-MSGID: 1787636980441227942 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);