From nobody Tue Feb 10 01:59:08 2026 Received: from canpmsgout06.his.huawei.com (canpmsgout06.his.huawei.com [113.46.200.221]) (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 F341F3D301E; Thu, 22 Jan 2026 15:47:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.221 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769096839; cv=none; b=cuFz4OKANh443hFqpndlr8ojgmQ9GEgrkYKgtrE0WgETteEVSe38cFt0EtlPnkFIRK0yTtWE22Zu6JDdASAJ6EGXiokT3K2n5LqlBp96X5mLmEQ2Fof03dSO2EExJzYVOuelz8dqIzKx/E8exGxzNf6ubqCVe2TttGjbScyGGAg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769096839; c=relaxed/simple; bh=X6rXmXUNuGdvzSdhj0LAFCXxZeuar96dp93fQeER5A8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XcyL0eFuCg9yrnO48jUQWPvDB9vkwUG0jnr8UHkFrSLIrfAMg5mVbZk6wbz2M6qHIssEZBl+A4D7SLTd1n5O2Kh6A/4UTRGsn53s8ZonCnln41S0MeLg1umAK2aOlMbpFlxaoFxxUgyBy6Hd9YswXPbrDJW19WeFp/uaBXUGSII= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=KapezA4+; arc=none smtp.client-ip=113.46.200.221 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="KapezA4+" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=8/z4J+w1iCPMn7FID9xjzFXXRGhz3sBJzrnlY03colw=; b=KapezA4+MCeSj48QqqVvPW7LPUYp4jPdBukSP5ooqAFz01Ftxgpi75y/Zhe5UGZ/VSty9Vagc P0a9tkuDKZJeisET9D/JJZV1MFx4eK5Kb5sOW9B9yIcyw9K/myBKx1XOMqor0+DmFtqp3b+2oCt XyCYJDNR1AaQnDQRFg8QCe4= Received: from mail.maildlp.com (unknown [172.19.162.140]) by canpmsgout06.his.huawei.com (SkyGuard) with ESMTPS id 4dxlhr5CstzRhR4; Thu, 22 Jan 2026 23:43:40 +0800 (CST) Received: from kwepemr500015.china.huawei.com (unknown [7.202.195.162]) by mail.maildlp.com (Postfix) with ESMTPS id 7DEA22016A; Thu, 22 Jan 2026 23:47:05 +0800 (CST) Received: from huawei.com (10.67.174.162) by kwepemr500015.china.huawei.com (7.202.195.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 22 Jan 2026 23:47:04 +0800 From: Hongbo Li To: , , CC: , , , , , , Subject: [PATCH v17 07/10] erofs: pass inode to trace_erofs_read_folio Date: Thu, 22 Jan 2026 15:34:03 +0000 Message-ID: <20260122153406.660073-8-lihongbo22@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20260122153406.660073-1-lihongbo22@huawei.com> References: <20260122153406.660073-1-lihongbo22@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems100002.china.huawei.com (7.221.188.206) To kwepemr500015.china.huawei.com (7.202.195.162) Content-Type: text/plain; charset="utf-8" The trace_erofs_read_folio accesses inode information through folio, but this method fails if the real inode is not associated with the folio(such as for the uncomping page cache sharing case). Therefore, we pass the real inode to it so that the inode information can be printed out in that case. Signed-off-by: Hongbo Li Reviewed-by: Gao Xiang --- fs/erofs/data.c | 6 ++---- fs/erofs/fileio.c | 2 +- fs/erofs/zdata.c | 2 +- include/trace/events/erofs.h | 10 +++++----- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/fs/erofs/data.c b/fs/erofs/data.c index 71e23d91123d..ea198defb531 100644 --- a/fs/erofs/data.c +++ b/fs/erofs/data.c @@ -385,8 +385,7 @@ static int erofs_read_folio(struct file *file, struct f= olio *folio) }; struct erofs_iomap_iter_ctx iter_ctx =3D {}; =20 - trace_erofs_read_folio(folio, true); - + trace_erofs_read_folio(folio_inode(folio), folio, true); iomap_read_folio(&erofs_iomap_ops, &read_ctx, &iter_ctx); return 0; } @@ -400,8 +399,7 @@ static void erofs_readahead(struct readahead_control *r= ac) struct erofs_iomap_iter_ctx iter_ctx =3D {}; =20 trace_erofs_readahead(rac->mapping->host, readahead_index(rac), - readahead_count(rac), true); - + readahead_count(rac), true); iomap_readahead(&erofs_iomap_ops, &read_ctx, &iter_ctx); } =20 diff --git a/fs/erofs/fileio.c b/fs/erofs/fileio.c index 932e8b353ba1..d07dc248d264 100644 --- a/fs/erofs/fileio.c +++ b/fs/erofs/fileio.c @@ -161,7 +161,7 @@ static int erofs_fileio_read_folio(struct file *file, s= truct folio *folio) struct erofs_fileio io =3D {}; int err; =20 - trace_erofs_read_folio(folio, true); + trace_erofs_read_folio(folio_inode(folio), folio, true); err =3D erofs_fileio_scan_folio(&io, folio); erofs_fileio_rq_submit(io.rq); return err; diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index 3d31f7840ca0..93ab6a481b64 100644 --- a/fs/erofs/zdata.c +++ b/fs/erofs/zdata.c @@ -1887,7 +1887,7 @@ static int z_erofs_read_folio(struct file *file, stru= ct folio *folio) Z_EROFS_DEFINE_FRONTEND(f, inode, folio_pos(folio)); int err; =20 - trace_erofs_read_folio(folio, false); + trace_erofs_read_folio(inode, folio, false); z_erofs_pcluster_readmore(&f, NULL, true); err =3D z_erofs_scan_folio(&f, folio, false); z_erofs_pcluster_readmore(&f, NULL, false); diff --git a/include/trace/events/erofs.h b/include/trace/events/erofs.h index dad7360f42f9..def20d06507b 100644 --- a/include/trace/events/erofs.h +++ b/include/trace/events/erofs.h @@ -82,9 +82,9 @@ TRACE_EVENT(erofs_fill_inode, =20 TRACE_EVENT(erofs_read_folio, =20 - TP_PROTO(struct folio *folio, bool raw), + TP_PROTO(struct inode *inode, struct folio *folio, bool raw), =20 - TP_ARGS(folio, raw), + TP_ARGS(inode, folio, raw), =20 TP_STRUCT__entry( __field(dev_t, dev ) @@ -96,9 +96,9 @@ TRACE_EVENT(erofs_read_folio, ), =20 TP_fast_assign( - __entry->dev =3D folio->mapping->host->i_sb->s_dev; - __entry->nid =3D EROFS_I(folio->mapping->host)->nid; - __entry->dir =3D S_ISDIR(folio->mapping->host->i_mode); + __entry->dev =3D inode->i_sb->s_dev; + __entry->nid =3D EROFS_I(inode)->nid; + __entry->dir =3D S_ISDIR(inode->i_mode); __entry->index =3D folio->index; __entry->uptodate =3D folio_test_uptodate(folio); __entry->raw =3D raw; --=20 2.22.0