linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] erofs: fix fsdax partition offset handling
@ 2022-01-13  5:18 Gao Xiang
  2022-01-13  7:21 ` Christoph Hellwig
  2022-01-24  7:11 ` Chao Yu
  0 siblings, 2 replies; 5+ messages in thread
From: Gao Xiang @ 2022-01-13  5:18 UTC (permalink / raw)
  To: linux-erofs, Chao Yu, Christoph Hellwig; +Cc: LKML, Gao Xiang

After seeking time on testing today upstream fsdax, I found it
actually doesn't work well as below:

[  186.492983] ------------[ cut here ]------------
[  186.493629] WARNING: CPU: 1 PID: 205 at fs/iomap/iter.c:33 iomap_iter+0x2f6/0x310

The problem is that m_dax_part_off should be applied to physical
addresses and very sorry about that I didn't catch this eariler.

Anyway, let's fix it up now. Also, I need to find a way to set up
a standalone testcase to look after this later.

Fixes: de2051147771 ("fsdax: shift partition offset handling into the file systems")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
 fs/erofs/data.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/erofs/data.c b/fs/erofs/data.c
index fa7ddb7ad980..226a57c57ee6 100644
--- a/fs/erofs/data.c
+++ b/fs/erofs/data.c
@@ -252,12 +252,10 @@ static int erofs_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
 		return ret;
 
 	iomap->offset = map.m_la;
-	if (flags & IOMAP_DAX) {
+	if (flags & IOMAP_DAX)
 		iomap->dax_dev = mdev.m_daxdev;
-		iomap->offset += mdev.m_dax_part_off;
-	} else {
+	else
 		iomap->bdev = mdev.m_bdev;
-	}
 	iomap->length = map.m_llen;
 	iomap->flags = 0;
 	iomap->private = NULL;
@@ -284,6 +282,8 @@ static int erofs_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
 	} else {
 		iomap->type = IOMAP_MAPPED;
 		iomap->addr = mdev.m_pa;
+		if (flags & IOMAP_DAX)
+			iomap->addr += mdev.m_dax_part_off;
 	}
 	return 0;
 }
-- 
2.24.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] erofs: fix fsdax partition offset handling
  2022-01-13  5:18 [PATCH] erofs: fix fsdax partition offset handling Gao Xiang
@ 2022-01-13  7:21 ` Christoph Hellwig
  2022-01-13 12:00   ` Gao Xiang
  2022-01-24  7:11 ` Chao Yu
  1 sibling, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2022-01-13  7:21 UTC (permalink / raw)
  To: Gao Xiang; +Cc: linux-erofs, Chao Yu, Christoph Hellwig, LKML

Looks good, thanks for fixing this up:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] erofs: fix fsdax partition offset handling
  2022-01-13  7:21 ` Christoph Hellwig
@ 2022-01-13 12:00   ` Gao Xiang
  0 siblings, 0 replies; 5+ messages in thread
From: Gao Xiang @ 2022-01-13 12:00 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-erofs, Chao Yu, LKML

On Thu, Jan 13, 2022 at 08:21:22AM +0100, Christoph Hellwig wrote:
> Looks good, thanks for fixing this up:
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>

Thanks for the review. Will apply later..

Thanks,
Gao Xiang

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] erofs: fix fsdax partition offset handling
  2022-01-13  5:18 [PATCH] erofs: fix fsdax partition offset handling Gao Xiang
  2022-01-13  7:21 ` Christoph Hellwig
@ 2022-01-24  7:11 ` Chao Yu
  2022-01-24  8:34   ` Gao Xiang
  1 sibling, 1 reply; 5+ messages in thread
From: Chao Yu @ 2022-01-24  7:11 UTC (permalink / raw)
  To: Gao Xiang, linux-erofs, Christoph Hellwig; +Cc: LKML

On 2022/1/13 13:18, Gao Xiang wrote:
> After seeking time on testing today upstream fsdax, I found it
> actually doesn't work well as below:
> 
> [  186.492983] ------------[ cut here ]------------
> [  186.493629] WARNING: CPU: 1 PID: 205 at fs/iomap/iter.c:33 iomap_iter+0x2f6/0x310
> 
> The problem is that m_dax_part_off should be applied to physical
> addresses and very sorry about that I didn't catch this eariler.
> 
> Anyway, let's fix it up now. Also, I need to find a way to set up
> a standalone testcase to look after this later.
> 
> Fixes: de2051147771 ("fsdax: shift partition offset handling into the file systems")
> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] erofs: fix fsdax partition offset handling
  2022-01-24  7:11 ` Chao Yu
@ 2022-01-24  8:34   ` Gao Xiang
  0 siblings, 0 replies; 5+ messages in thread
From: Gao Xiang @ 2022-01-24  8:34 UTC (permalink / raw)
  To: Chao Yu; +Cc: linux-erofs, Christoph Hellwig, LKML

On Mon, Jan 24, 2022 at 03:11:35PM +0800, Chao Yu wrote:
> On 2022/1/13 13:18, Gao Xiang wrote:
> > After seeking time on testing today upstream fsdax, I found it
> > actually doesn't work well as below:
> > 
> > [  186.492983] ------------[ cut here ]------------
> > [  186.493629] WARNING: CPU: 1 PID: 205 at fs/iomap/iter.c:33 iomap_iter+0x2f6/0x310
> > 
> > The problem is that m_dax_part_off should be applied to physical
> > addresses and very sorry about that I didn't catch this eariler.
> > 
> > Anyway, let's fix it up now. Also, I need to find a way to set up
> > a standalone testcase to look after this later.
> > 
> > Fixes: de2051147771 ("fsdax: shift partition offset handling into the file systems")
> > Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
> 
> Reviewed-by: Chao Yu <chao@kernel.org>

Thanks for the review! I will send this together with other misc
fixes this or next week..

Thanks,
Gao Xiang

> 
> Thanks,

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-01-24  8:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-13  5:18 [PATCH] erofs: fix fsdax partition offset handling Gao Xiang
2022-01-13  7:21 ` Christoph Hellwig
2022-01-13 12:00   ` Gao Xiang
2022-01-24  7:11 ` Chao Yu
2022-01-24  8:34   ` Gao Xiang

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).