From patchwork Mon Jan 22 12:38:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 190148 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp2541733dyb; Mon, 22 Jan 2024 04:42:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGMYNK/G6WnYbHqZJ7pVxd3PPaSEDG7ggct7W/sX1t4LmYgNcDtnlKlouYZkJJybL5qE8y X-Received: by 2002:a0c:cc12:0:b0:681:1e0:96c with SMTP id r18-20020a0ccc12000000b0068101e0096cmr3279956qvk.121.1705927346121; Mon, 22 Jan 2024 04:42:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705927346; cv=pass; d=google.com; s=arc-20160816; b=EVw75oYxwtFBipQj2Ovo/FOhJG5OFCaHwTTvU0b/9pgdQ/cr5VxbiK7+lGEzAH2x/f IHCBLvlwO5y8BRlzhk5jFjxs46taZWgl+IDynRfAJE+0abxCpGuoJgrZUK3Wo3Xuz8uH WfiR1pq/zYXqUkkmhvnvnbXFcOxIVD/JfpxA2wjbUKLEAWB/kJMXlyO+L3rz2nT3Hory 4k6D9YZY1rrf/xWctDtqsW/nniMETEKNwAHTRpRTj/zO6juAFlWWKDECTz4VvHq2UUk8 NduBEaFrVonC4H3Dx8VBCZb5fB7eWZo+ls31HDDLN1+mI4TSNEAUdiaJRFVnHxK0H6+W ypGQ== ARC-Message-Signature: i=2; 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=QTcyfpP5bcZKRoP4ztPdz4r44FpI3I5eD9lUKEvfqoQ=; fh=skzBpizSTLxeNi7YvbVsOvigb/503Q6Jm7wBBDKs1ys=; b=YglHgBqlTSq/CIsJb4uUozE6FkOody4bb3+VJ+r8B7JwPe3W2XNVf4A4Xyzyk26ONU nQQ/LzUqx5HoAYMm/H5E56BDzpfWYRiDQuomTRKwuou+WSQlUsXnOwCjkqi6ldivQVhb TYrAjOVkWTAVU82mUdjtCRRcjoTEE7ZqngGwy0heghn9ksHVmi1G2S1zq0tlei+M1v3p uFSIRCLq77A9/I9cUpfHpdBg4n1/7lDL5WF/cuTdriLH/l8/ag2Iv29jlHXfgBKeMqIj 1kiJwSGUbDrPDcR0127GR4Lpv/QHhW3gr4mY8QHxgHY27r9SzaI3UE/p2irXPx/t9fhY qiEg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Ei/V1F65"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-33033-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33033-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 q4-20020a0c9a44000000b0067f6c300e91si5437684qvd.328.2024.01.22.04.42.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 04:42:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33033-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="Ei/V1F65"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-33033-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33033-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 E47A01C22EC3 for ; Mon, 22 Jan 2024 12:42:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 713D43DBAE; Mon, 22 Jan 2024 12:39:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Ei/V1F65" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 E399C3D567 for ; Mon, 22 Jan 2024 12:39:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705927149; cv=none; b=TQYCUTQI4g4swsB8eU5SXg4NE8bTo5/gcFPTmN6g+ZeznIHSXUICjNDzegHEt1qciZXwudE0uFMKF9m2e8ehEZSuHnY3EMnR0qgnucLZN4OD7fP8krNLl0z/5Xf8BVtblrqcdXbilUEo/ZjS8ZjaxpNKwewArjgfe03YXqWbvM8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705927149; c=relaxed/simple; bh=+xGlq8qo/+56ZzcegYaekvbisegxnMruSd7lD52DUF4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=c4jnN1+RW0m7AuMzZ4S74JsTzQWPUVdQRVWwWZhQpLzApyiQdnuAAxwFqx6cljf95kY6W6ckeL4ZgOaCFVOzD3BRh2+6QBvRBadl/7HPVIPJttT9JCxW/32Ef+6WDh8PBK0H3Cg4tbkmjEN7i+UDsFKwe/ml9C41bEGfvmSwO6s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Ei/V1F65; arc=none smtp.client-ip=170.10.129.124 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=1705927147; 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=QTcyfpP5bcZKRoP4ztPdz4r44FpI3I5eD9lUKEvfqoQ=; b=Ei/V1F65MSh95Lgvrt+lzMkBulUpkJ0qkUdlBfQQga3CZKmEW6yq5w7urRCWCL1CIBkHPS Ruc702nPvGy/sGzCKYhqLe84Rvv5TsSudc2I6bj7W1ODIH4mp79gWTqFw/yuKMjz0yEhQP UrCPhaENazOVH+i5iTmuznAwijAGbTc= 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-257-n3Heej4FNhmdGcMa83qE8w-1; Mon, 22 Jan 2024 07:39:00 -0500 X-MC-Unique: n3Heej4FNhmdGcMa83qE8w-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (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 BA32285A588; Mon, 22 Jan 2024 12:38:59 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2A95A1C060AF; Mon, 22 Jan 2024 12:38:57 +0000 (UTC) From: David Howells To: Christian Brauner Cc: David Howells , Jeff Layton , Matthew Wilcox , netfs@lists.linux.dev, 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, linux-kernel@vger.kernel.org, Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey Subject: [PATCH 03/10] cifs: Don't use certain internal folio_*() functions Date: Mon, 22 Jan 2024 12:38:36 +0000 Message-ID: <20240122123845.3822570-4-dhowells@redhat.com> In-Reply-To: <20240122123845.3822570-1-dhowells@redhat.com> References: <20240122123845.3822570-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.7 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788794472660460715 X-GMAIL-MSGID: 1788794472660460715 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 3a213432775b..90da81d0372a 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; } @@ -2651,7 +2651,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);