From: Eliav Farber <farbere@amazon.com>
To: <gregkh@linuxfoundation.org>, <stable-commits@vger.kernel.org>,
<viro@zeniv.linux.org.uk>, <dan.j.williams@intel.com>,
<willy@infradead.org>, <jack@suse.cz>,
<linux-fsdevel@vger.kernel.org>, <linux-nvdimm@lists.01.org>,
<linux-kernel@vger.kernel.org>
Cc: <farbere@amazon.com>, Christoph Hellwig <hch@lst.de>,
"Darrick J. Wong" <djwong@kernel.org>
Subject: [PATCH v5.10.y] fsdax: mark the iomap argument to dax_iomap_sector as const
Date: Sun, 9 Nov 2025 11:31:51 +0000 [thread overview]
Message-ID: <20251109113151.48263-1-farbere@amazon.com> (raw)
From: Christoph Hellwig <hch@lst.de>
[ Upstream commit 7e4f4b2d689d959b03cb07dfbdb97b9696cb1076 ]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
Fixes:
fs/dax.c: In function 'dax_iomap_iter':
fs/dax.c:1147:44: error: passing argument 1 of 'dax_iomap_sector' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
const sector_t sector = dax_iomap_sector(iomap, pos);
^~~~~
fs/dax.c:1009:17: note: expected 'struct iomap *' but argument is of type 'const struct iomap *'
static sector_t dax_iomap_sector(struct iomap *iomap, loff_t pos)
^~~~~~~~~~~~~~~~
The issue was introduced by the cherry-pick of commit 8df4919cb921
("fsdax: switch dax_iomap_rw to use iomap_iter")
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/fs/dax.c?h=v5.10.246&id=8df4919cb921b28809d05feae3e98dc5d8b48146
The upstream change made callers pass a const struct iomap *:
const struct iomap *iomap = &iomi->iomap;
but dax_iomap_sector() still expected a mutable pointer:
static sector_t dax_iomap_sector(struct iomap *iomap, loff_t pos)
fs/dax.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/dax.c b/fs/dax.c
index 91820b9b50b7..2ca33ef5d519 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -1006,7 +1006,7 @@ int dax_writeback_mapping_range(struct address_space *mapping,
}
EXPORT_SYMBOL_GPL(dax_writeback_mapping_range);
-static sector_t dax_iomap_sector(struct iomap *iomap, loff_t pos)
+static sector_t dax_iomap_sector(const struct iomap *iomap, loff_t pos)
{
return (iomap->addr + (pos & PAGE_MASK) - iomap->offset) >> 9;
}
--
2.47.3
reply other threads:[~2025-11-09 11:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251109113151.48263-1-farbere@amazon.com \
--to=farbere@amazon.com \
--cc=dan.j.williams@intel.com \
--cc=djwong@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hch@lst.de \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvdimm@lists.01.org \
--cc=stable-commits@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).