All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6.5.y] erofs: ensure that the post-EOF tails are all zeroed
@ 2023-08-31 11:29 ` Gao Xiang
  0 siblings, 0 replies; 23+ messages in thread
From: Gao Xiang @ 2023-08-31 11:29 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman; +Cc: Gao Xiang, linux-erofs, keltargw

commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.

This was accidentally fixed up in commit e4c1cf523d82 but we can't
take the full change due to other dependancy issues, so here is just
the actual bugfix that is needed.

[Background]

keltargw reported an issue [1] that with mmaped I/Os, sometimes the
tail of the last page (after file ends) is not filled with zeroes.

The root cause is that such tail page could be wrongly selected for
inplace I/Os so the zeroed part will then be filled with compressed
data instead of zeroes.

A simple fix is to avoid doing inplace I/Os for such tail parts,
actually that was already fixed upstream in commit e4c1cf523d82
("erofs: tidy up z_erofs_do_read_page()") by accident.

[1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com

Reported-by: keltargw <keltar.gw@gmail.com>
Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
 fs/erofs/zdata.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index de4f12152b62..9c9350eb1704 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -1038,6 +1038,8 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
 	cur = end - min_t(erofs_off_t, offset + end - map->m_la, end);
 	if (!(map->m_flags & EROFS_MAP_MAPPED)) {
 		zero_user_segment(page, cur, end);
+		++spiltted;
+		tight = false;
 		goto next_part;
 	}
 	if (map->m_flags & EROFS_MAP_FRAGMENT) {
-- 
2.24.4


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

* [PATCH 6.5.y] erofs: ensure that the post-EOF tails are all zeroed
@ 2023-08-31 11:29 ` Gao Xiang
  0 siblings, 0 replies; 23+ messages in thread
From: Gao Xiang @ 2023-08-31 11:29 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman; +Cc: linux-erofs, Gao Xiang, keltargw

commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.

This was accidentally fixed up in commit e4c1cf523d82 but we can't
take the full change due to other dependancy issues, so here is just
the actual bugfix that is needed.

[Background]

keltargw reported an issue [1] that with mmaped I/Os, sometimes the
tail of the last page (after file ends) is not filled with zeroes.

The root cause is that such tail page could be wrongly selected for
inplace I/Os so the zeroed part will then be filled with compressed
data instead of zeroes.

A simple fix is to avoid doing inplace I/Os for such tail parts,
actually that was already fixed upstream in commit e4c1cf523d82
("erofs: tidy up z_erofs_do_read_page()") by accident.

[1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com

Reported-by: keltargw <keltar.gw@gmail.com>
Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
 fs/erofs/zdata.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index de4f12152b62..9c9350eb1704 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -1038,6 +1038,8 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
 	cur = end - min_t(erofs_off_t, offset + end - map->m_la, end);
 	if (!(map->m_flags & EROFS_MAP_MAPPED)) {
 		zero_user_segment(page, cur, end);
+		++spiltted;
+		tight = false;
 		goto next_part;
 	}
 	if (map->m_flags & EROFS_MAP_FRAGMENT) {
-- 
2.24.4


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

* [PATCH 6.4.y] erofs: ensure that the post-EOF tails are all zeroed
  2023-08-31 11:29 ` Gao Xiang
@ 2023-08-31 11:29   ` Gao Xiang
  -1 siblings, 0 replies; 23+ messages in thread
From: Gao Xiang @ 2023-08-31 11:29 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman; +Cc: Gao Xiang, linux-erofs, keltargw

commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.

This was accidentally fixed up in commit e4c1cf523d82 but we can't
take the full change due to other dependancy issues, so here is just
the actual bugfix that is needed.

[Background]

keltargw reported an issue [1] that with mmaped I/Os, sometimes the
tail of the last page (after file ends) is not filled with zeroes.

The root cause is that such tail page could be wrongly selected for
inplace I/Os so the zeroed part will then be filled with compressed
data instead of zeroes.

A simple fix is to avoid doing inplace I/Os for such tail parts,
actually that was already fixed upstream in commit e4c1cf523d82
("erofs: tidy up z_erofs_do_read_page()") by accident.

[1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com

Reported-by: keltargw <keltar.gw@gmail.com>
Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
 fs/erofs/zdata.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index 470988bb7867..9a7c8bb0590f 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -993,6 +993,8 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
 	cur = end - min_t(erofs_off_t, offset + end - map->m_la, end);
 	if (!(map->m_flags & EROFS_MAP_MAPPED)) {
 		zero_user_segment(page, cur, end);
+		++spiltted;
+		tight = false;
 		goto next_part;
 	}
 	if (map->m_flags & EROFS_MAP_FRAGMENT) {
-- 
2.24.4


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

* [PATCH 6.4.y] erofs: ensure that the post-EOF tails are all zeroed
@ 2023-08-31 11:29   ` Gao Xiang
  0 siblings, 0 replies; 23+ messages in thread
From: Gao Xiang @ 2023-08-31 11:29 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman; +Cc: linux-erofs, Gao Xiang, keltargw

commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.

This was accidentally fixed up in commit e4c1cf523d82 but we can't
take the full change due to other dependancy issues, so here is just
the actual bugfix that is needed.

[Background]

keltargw reported an issue [1] that with mmaped I/Os, sometimes the
tail of the last page (after file ends) is not filled with zeroes.

The root cause is that such tail page could be wrongly selected for
inplace I/Os so the zeroed part will then be filled with compressed
data instead of zeroes.

A simple fix is to avoid doing inplace I/Os for such tail parts,
actually that was already fixed upstream in commit e4c1cf523d82
("erofs: tidy up z_erofs_do_read_page()") by accident.

[1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com

Reported-by: keltargw <keltar.gw@gmail.com>
Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
 fs/erofs/zdata.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index 470988bb7867..9a7c8bb0590f 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -993,6 +993,8 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
 	cur = end - min_t(erofs_off_t, offset + end - map->m_la, end);
 	if (!(map->m_flags & EROFS_MAP_MAPPED)) {
 		zero_user_segment(page, cur, end);
+		++spiltted;
+		tight = false;
 		goto next_part;
 	}
 	if (map->m_flags & EROFS_MAP_FRAGMENT) {
-- 
2.24.4


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

* [PATCH 6.1.y] erofs: ensure that the post-EOF tails are all zeroed
  2023-08-31 11:29 ` Gao Xiang
@ 2023-08-31 11:29   ` Gao Xiang
  -1 siblings, 0 replies; 23+ messages in thread
From: Gao Xiang @ 2023-08-31 11:29 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman; +Cc: Gao Xiang, linux-erofs, keltargw

commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.

This was accidentally fixed up in commit e4c1cf523d82 but we can't
take the full change due to other dependancy issues, so here is just
the actual bugfix that is needed.

[Background]

keltargw reported an issue [1] that with mmaped I/Os, sometimes the
tail of the last page (after file ends) is not filled with zeroes.

The root cause is that such tail page could be wrongly selected for
inplace I/Os so the zeroed part will then be filled with compressed
data instead of zeroes.

A simple fix is to avoid doing inplace I/Os for such tail parts,
actually that was already fixed upstream in commit e4c1cf523d82
("erofs: tidy up z_erofs_do_read_page()") by accident.

[1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com

Reported-by: keltargw <keltar.gw@gmail.com>
Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
 fs/erofs/zdata.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index 361f3c29897e..1b91ac5be961 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -869,6 +869,8 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
 	cur = end - min_t(erofs_off_t, offset + end - map->m_la, end);
 	if (!(map->m_flags & EROFS_MAP_MAPPED)) {
 		zero_user_segment(page, cur, end);
+		++spiltted;
+		tight = false;
 		goto next_part;
 	}
 	if (map->m_flags & EROFS_MAP_FRAGMENT) {
-- 
2.24.4


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

* [PATCH 6.1.y] erofs: ensure that the post-EOF tails are all zeroed
@ 2023-08-31 11:29   ` Gao Xiang
  0 siblings, 0 replies; 23+ messages in thread
From: Gao Xiang @ 2023-08-31 11:29 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman; +Cc: linux-erofs, Gao Xiang, keltargw

commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.

This was accidentally fixed up in commit e4c1cf523d82 but we can't
take the full change due to other dependancy issues, so here is just
the actual bugfix that is needed.

[Background]

keltargw reported an issue [1] that with mmaped I/Os, sometimes the
tail of the last page (after file ends) is not filled with zeroes.

The root cause is that such tail page could be wrongly selected for
inplace I/Os so the zeroed part will then be filled with compressed
data instead of zeroes.

A simple fix is to avoid doing inplace I/Os for such tail parts,
actually that was already fixed upstream in commit e4c1cf523d82
("erofs: tidy up z_erofs_do_read_page()") by accident.

[1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com

Reported-by: keltargw <keltar.gw@gmail.com>
Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
 fs/erofs/zdata.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index 361f3c29897e..1b91ac5be961 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -869,6 +869,8 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
 	cur = end - min_t(erofs_off_t, offset + end - map->m_la, end);
 	if (!(map->m_flags & EROFS_MAP_MAPPED)) {
 		zero_user_segment(page, cur, end);
+		++spiltted;
+		tight = false;
 		goto next_part;
 	}
 	if (map->m_flags & EROFS_MAP_FRAGMENT) {
-- 
2.24.4


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

* [PATCH 5.15.y] erofs: ensure that the post-EOF tails are all zeroed
  2023-08-31 11:29 ` Gao Xiang
@ 2023-08-31 11:29   ` Gao Xiang
  -1 siblings, 0 replies; 23+ messages in thread
From: Gao Xiang @ 2023-08-31 11:29 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman; +Cc: Gao Xiang, linux-erofs, keltargw

commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.

This was accidentally fixed up in commit e4c1cf523d82 but we can't
take the full change due to other dependancy issues, so here is just
the actual bugfix that is needed.

[Background]

keltargw reported an issue [1] that with mmaped I/Os, sometimes the
tail of the last page (after file ends) is not filled with zeroes.

The root cause is that such tail page could be wrongly selected for
inplace I/Os so the zeroed part will then be filled with compressed
data instead of zeroes.

A simple fix is to avoid doing inplace I/Os for such tail parts,
actually that was already fixed upstream in commit e4c1cf523d82
("erofs: tidy up z_erofs_do_read_page()") by accident.

[1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com

Reported-by: keltargw <keltar.gw@gmail.com>
Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
 fs/erofs/zdata.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index c247b1bf57cc..f6536b224586 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -716,6 +716,8 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
 	cur = end - min_t(erofs_off_t, offset + end - map->m_la, end);
 	if (!(map->m_flags & EROFS_MAP_MAPPED)) {
 		zero_user_segment(page, cur, end);
+		++spiltted;
+		tight = false;
 		goto next_part;
 	}
 
-- 
2.24.4


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

* [PATCH 5.15.y] erofs: ensure that the post-EOF tails are all zeroed
@ 2023-08-31 11:29   ` Gao Xiang
  0 siblings, 0 replies; 23+ messages in thread
From: Gao Xiang @ 2023-08-31 11:29 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman; +Cc: linux-erofs, Gao Xiang, keltargw

commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.

This was accidentally fixed up in commit e4c1cf523d82 but we can't
take the full change due to other dependancy issues, so here is just
the actual bugfix that is needed.

[Background]

keltargw reported an issue [1] that with mmaped I/Os, sometimes the
tail of the last page (after file ends) is not filled with zeroes.

The root cause is that such tail page could be wrongly selected for
inplace I/Os so the zeroed part will then be filled with compressed
data instead of zeroes.

A simple fix is to avoid doing inplace I/Os for such tail parts,
actually that was already fixed upstream in commit e4c1cf523d82
("erofs: tidy up z_erofs_do_read_page()") by accident.

[1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com

Reported-by: keltargw <keltar.gw@gmail.com>
Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
 fs/erofs/zdata.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index c247b1bf57cc..f6536b224586 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -716,6 +716,8 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
 	cur = end - min_t(erofs_off_t, offset + end - map->m_la, end);
 	if (!(map->m_flags & EROFS_MAP_MAPPED)) {
 		zero_user_segment(page, cur, end);
+		++spiltted;
+		tight = false;
 		goto next_part;
 	}
 
-- 
2.24.4


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

* [PATCH 5.10.y] erofs: ensure that the post-EOF tails are all zeroed
  2023-08-31 11:29 ` Gao Xiang
@ 2023-08-31 11:29   ` Gao Xiang
  -1 siblings, 0 replies; 23+ messages in thread
From: Gao Xiang @ 2023-08-31 11:29 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman; +Cc: Gao Xiang, linux-erofs, keltargw

commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.

This was accidentally fixed up in commit e4c1cf523d82 but we can't
take the full change due to other dependancy issues, so here is just
the actual bugfix that is needed.

[Background]

keltargw reported an issue [1] that with mmaped I/Os, sometimes the
tail of the last page (after file ends) is not filled with zeroes.

The root cause is that such tail page could be wrongly selected for
inplace I/Os so the zeroed part will then be filled with compressed
data instead of zeroes.

A simple fix is to avoid doing inplace I/Os for such tail parts,
actually that was already fixed upstream in commit e4c1cf523d82
("erofs: tidy up z_erofs_do_read_page()") by accident.

[1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com

Reported-by: keltargw <keltar.gw@gmail.com>
Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
 fs/erofs/zdata.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index 9cff92738259..da133950d514 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -632,6 +632,8 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
 	cur = end - min_t(erofs_off_t, offset + end - map->m_la, end);
 	if (!(map->m_flags & EROFS_MAP_MAPPED)) {
 		zero_user_segment(page, cur, end);
+		++spiltted;
+		tight = false;
 		goto next_part;
 	}
 
-- 
2.24.4


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

* [PATCH 5.10.y] erofs: ensure that the post-EOF tails are all zeroed
@ 2023-08-31 11:29   ` Gao Xiang
  0 siblings, 0 replies; 23+ messages in thread
From: Gao Xiang @ 2023-08-31 11:29 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman; +Cc: linux-erofs, Gao Xiang, keltargw

commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.

This was accidentally fixed up in commit e4c1cf523d82 but we can't
take the full change due to other dependancy issues, so here is just
the actual bugfix that is needed.

[Background]

keltargw reported an issue [1] that with mmaped I/Os, sometimes the
tail of the last page (after file ends) is not filled with zeroes.

The root cause is that such tail page could be wrongly selected for
inplace I/Os so the zeroed part will then be filled with compressed
data instead of zeroes.

A simple fix is to avoid doing inplace I/Os for such tail parts,
actually that was already fixed upstream in commit e4c1cf523d82
("erofs: tidy up z_erofs_do_read_page()") by accident.

[1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com

Reported-by: keltargw <keltar.gw@gmail.com>
Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
 fs/erofs/zdata.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index 9cff92738259..da133950d514 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -632,6 +632,8 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
 	cur = end - min_t(erofs_off_t, offset + end - map->m_la, end);
 	if (!(map->m_flags & EROFS_MAP_MAPPED)) {
 		zero_user_segment(page, cur, end);
+		++spiltted;
+		tight = false;
 		goto next_part;
 	}
 
-- 
2.24.4


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

* [PATCH 5.4.y] erofs: ensure that the post-EOF tails are all zeroed
  2023-08-31 11:29 ` Gao Xiang
@ 2023-08-31 11:29   ` Gao Xiang
  -1 siblings, 0 replies; 23+ messages in thread
From: Gao Xiang @ 2023-08-31 11:29 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman; +Cc: Gao Xiang, linux-erofs, keltargw

commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.

This was accidentally fixed up in commit e4c1cf523d82 but we can't
take the full change due to other dependancy issues, so here is just
the actual bugfix that is needed.

[Background]

keltargw reported an issue [1] that with mmaped I/Os, sometimes the
tail of the last page (after file ends) is not filled with zeroes.

The root cause is that such tail page could be wrongly selected for
inplace I/Os so the zeroed part will then be filled with compressed
data instead of zeroes.

A simple fix is to avoid doing inplace I/Os for such tail parts,
actually that was already fixed upstream in commit e4c1cf523d82
("erofs: tidy up z_erofs_do_read_page()") by accident.

[1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com

Reported-by: keltargw <keltar.gw@gmail.com>
Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
 fs/erofs/zdata.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index dcc377094f90..fb718c3e3ebd 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -639,6 +639,8 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
 	cur = end - min_t(erofs_off_t, offset + end - map->m_la, end);
 	if (!(map->m_flags & EROFS_MAP_MAPPED)) {
 		zero_user_segment(page, cur, end);
+		++spiltted;
+		tight = false;
 		goto next_part;
 	}
 
-- 
2.24.4


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

* [PATCH 5.4.y] erofs: ensure that the post-EOF tails are all zeroed
@ 2023-08-31 11:29   ` Gao Xiang
  0 siblings, 0 replies; 23+ messages in thread
From: Gao Xiang @ 2023-08-31 11:29 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman; +Cc: linux-erofs, Gao Xiang, keltargw

commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.

This was accidentally fixed up in commit e4c1cf523d82 but we can't
take the full change due to other dependancy issues, so here is just
the actual bugfix that is needed.

[Background]

keltargw reported an issue [1] that with mmaped I/Os, sometimes the
tail of the last page (after file ends) is not filled with zeroes.

The root cause is that such tail page could be wrongly selected for
inplace I/Os so the zeroed part will then be filled with compressed
data instead of zeroes.

A simple fix is to avoid doing inplace I/Os for such tail parts,
actually that was already fixed upstream in commit e4c1cf523d82
("erofs: tidy up z_erofs_do_read_page()") by accident.

[1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com

Reported-by: keltargw <keltar.gw@gmail.com>
Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
 fs/erofs/zdata.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index dcc377094f90..fb718c3e3ebd 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -639,6 +639,8 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
 	cur = end - min_t(erofs_off_t, offset + end - map->m_la, end);
 	if (!(map->m_flags & EROFS_MAP_MAPPED)) {
 		zero_user_segment(page, cur, end);
+		++spiltted;
+		tight = false;
 		goto next_part;
 	}
 
-- 
2.24.4


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

* [PATCH 4.19.y] erofs: ensure that the post-EOF tails are all zeroed
  2023-08-31 11:29 ` Gao Xiang
@ 2023-08-31 11:29   ` Gao Xiang
  -1 siblings, 0 replies; 23+ messages in thread
From: Gao Xiang @ 2023-08-31 11:29 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman; +Cc: Gao Xiang, linux-erofs, keltargw

commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.

This was accidentally fixed up in commit e4c1cf523d82 but we can't
take the full change due to other dependancy issues, so here is just
the actual bugfix that is needed.

[Background]

keltargw reported an issue [1] that with mmaped I/Os, sometimes the
tail of the last page (after file ends) is not filled with zeroes.

The root cause is that such tail page could be wrongly selected for
inplace I/Os so the zeroed part will then be filled with compressed
data instead of zeroes.

A simple fix is to avoid doing inplace I/Os for such tail parts,
actually that was already fixed upstream in commit e4c1cf523d82
("erofs: tidy up z_erofs_do_read_page()") by accident.

[1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com

Reported-by: keltargw <keltar.gw@gmail.com>
Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
 drivers/staging/erofs/unzip_vle.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/erofs/unzip_vle.c b/drivers/staging/erofs/unzip_vle.c
index 83e4d9384bd2..7ccc4a18a900 100644
--- a/drivers/staging/erofs/unzip_vle.c
+++ b/drivers/staging/erofs/unzip_vle.c
@@ -675,6 +675,8 @@ static int z_erofs_do_read_page(struct z_erofs_vle_frontend *fe,
 	cur = end - min_t(unsigned, offset + end - map->m_la, end);
 	if (unlikely(!(map->m_flags & EROFS_MAP_MAPPED))) {
 		zero_user_segment(page, cur, end);
+		++spiltted;
+		tight = false;
 		goto next_part;
 	}
 
-- 
2.24.4


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

* [PATCH 4.19.y] erofs: ensure that the post-EOF tails are all zeroed
@ 2023-08-31 11:29   ` Gao Xiang
  0 siblings, 0 replies; 23+ messages in thread
From: Gao Xiang @ 2023-08-31 11:29 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman; +Cc: linux-erofs, Gao Xiang, keltargw

commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.

This was accidentally fixed up in commit e4c1cf523d82 but we can't
take the full change due to other dependancy issues, so here is just
the actual bugfix that is needed.

[Background]

keltargw reported an issue [1] that with mmaped I/Os, sometimes the
tail of the last page (after file ends) is not filled with zeroes.

The root cause is that such tail page could be wrongly selected for
inplace I/Os so the zeroed part will then be filled with compressed
data instead of zeroes.

A simple fix is to avoid doing inplace I/Os for such tail parts,
actually that was already fixed upstream in commit e4c1cf523d82
("erofs: tidy up z_erofs_do_read_page()") by accident.

[1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com

Reported-by: keltargw <keltar.gw@gmail.com>
Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
 drivers/staging/erofs/unzip_vle.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/erofs/unzip_vle.c b/drivers/staging/erofs/unzip_vle.c
index 83e4d9384bd2..7ccc4a18a900 100644
--- a/drivers/staging/erofs/unzip_vle.c
+++ b/drivers/staging/erofs/unzip_vle.c
@@ -675,6 +675,8 @@ static int z_erofs_do_read_page(struct z_erofs_vle_frontend *fe,
 	cur = end - min_t(unsigned, offset + end - map->m_la, end);
 	if (unlikely(!(map->m_flags & EROFS_MAP_MAPPED))) {
 		zero_user_segment(page, cur, end);
+		++spiltted;
+		tight = false;
 		goto next_part;
 	}
 
-- 
2.24.4


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

* Patch "erofs: ensure that the post-EOF tails are all zeroed" has been added to the 4.19-stable tree
  2023-08-31 11:29   ` Gao Xiang
  (?)
@ 2023-09-02  8:19   ` gregkh
  -1 siblings, 0 replies; 23+ messages in thread
From: gregkh @ 2023-09-02  8:19 UTC (permalink / raw)
  To: 3ad8b469-25db-a297-21f9-75db2d6ad224, gregkh, hsiangkao,
	keltar.gw, linux-erofs
  Cc: stable-commits


This is a note to let you know that I've just added the patch titled

    erofs: ensure that the post-EOF tails are all zeroed

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


From hsiangkao@linux.alibaba.com  Sat Sep  2 10:18:30 2023
From: Gao Xiang <hsiangkao@linux.alibaba.com>
Date: Thu, 31 Aug 2023 19:29:59 +0800
Subject: erofs: ensure that the post-EOF tails are all zeroed
To: stable@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-erofs@lists.ozlabs.org, Gao Xiang <hsiangkao@linux.alibaba.com>, keltargw <keltar.gw@gmail.com>
Message-ID: <20230831112959.99884-7-hsiangkao@linux.alibaba.com>

From: Gao Xiang <hsiangkao@linux.alibaba.com>

commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.

This was accidentally fixed up in commit e4c1cf523d82 but we can't
take the full change due to other dependancy issues, so here is just
the actual bugfix that is needed.

[Background]

keltargw reported an issue [1] that with mmaped I/Os, sometimes the
tail of the last page (after file ends) is not filled with zeroes.

The root cause is that such tail page could be wrongly selected for
inplace I/Os so the zeroed part will then be filled with compressed
data instead of zeroes.

A simple fix is to avoid doing inplace I/Os for such tail parts,
actually that was already fixed upstream in commit e4c1cf523d82
("erofs: tidy up z_erofs_do_read_page()") by accident.

[1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com

Reported-by: keltargw <keltar.gw@gmail.com>
Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/staging/erofs/unzip_vle.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/staging/erofs/unzip_vle.c
+++ b/drivers/staging/erofs/unzip_vle.c
@@ -675,6 +675,8 @@ hitted:
 	cur = end - min_t(unsigned, offset + end - map->m_la, end);
 	if (unlikely(!(map->m_flags & EROFS_MAP_MAPPED))) {
 		zero_user_segment(page, cur, end);
+		++spiltted;
+		tight = false;
 		goto next_part;
 	}
 


Patches currently in stable-queue which might be from hsiangkao@linux.alibaba.com are

queue-4.19/erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch

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

* Patch "erofs: ensure that the post-EOF tails are all zeroed" has been added to the 5.4-stable tree
  2023-08-31 11:29   ` Gao Xiang
  (?)
@ 2023-09-02  8:19   ` gregkh
  -1 siblings, 0 replies; 23+ messages in thread
From: gregkh @ 2023-09-02  8:19 UTC (permalink / raw)
  To: 3ad8b469-25db-a297-21f9-75db2d6ad224, gregkh, hsiangkao,
	keltar.gw, linux-erofs
  Cc: stable-commits


This is a note to let you know that I've just added the patch titled

    erofs: ensure that the post-EOF tails are all zeroed

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


From hsiangkao@linux.alibaba.com  Sat Sep  2 09:30:52 2023
From: Gao Xiang <hsiangkao@linux.alibaba.com>
Date: Thu, 31 Aug 2023 19:29:58 +0800
Subject: erofs: ensure that the post-EOF tails are all zeroed
To: stable@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-erofs@lists.ozlabs.org, Gao Xiang <hsiangkao@linux.alibaba.com>, keltargw <keltar.gw@gmail.com>
Message-ID: <20230831112959.99884-6-hsiangkao@linux.alibaba.com>

From: Gao Xiang <hsiangkao@linux.alibaba.com>

commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.

This was accidentally fixed up in commit e4c1cf523d82 but we can't
take the full change due to other dependancy issues, so here is just
the actual bugfix that is needed.

[Background]

keltargw reported an issue [1] that with mmaped I/Os, sometimes the
tail of the last page (after file ends) is not filled with zeroes.

The root cause is that such tail page could be wrongly selected for
inplace I/Os so the zeroed part will then be filled with compressed
data instead of zeroes.

A simple fix is to avoid doing inplace I/Os for such tail parts,
actually that was already fixed upstream in commit e4c1cf523d82
("erofs: tidy up z_erofs_do_read_page()") by accident.

[1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com

Reported-by: keltargw <keltar.gw@gmail.com>
Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/erofs/zdata.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -639,6 +639,8 @@ hitted:
 	cur = end - min_t(erofs_off_t, offset + end - map->m_la, end);
 	if (!(map->m_flags & EROFS_MAP_MAPPED)) {
 		zero_user_segment(page, cur, end);
+		++spiltted;
+		tight = false;
 		goto next_part;
 	}
 


Patches currently in stable-queue which might be from hsiangkao@linux.alibaba.com are

queue-5.4/erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch

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

* Re: [PATCH 6.5.y] erofs: ensure that the post-EOF tails are all zeroed
  2023-08-31 11:29 ` Gao Xiang
@ 2023-09-02  8:19   ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 23+ messages in thread
From: Greg Kroah-Hartman @ 2023-09-02  8:19 UTC (permalink / raw)
  To: Gao Xiang; +Cc: linux-erofs, stable, keltargw

On Thu, Aug 31, 2023 at 07:29:53PM +0800, Gao Xiang wrote:
> commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.
> 
> This was accidentally fixed up in commit e4c1cf523d82 but we can't
> take the full change due to other dependancy issues, so here is just
> the actual bugfix that is needed.
> 
> [Background]
> 
> keltargw reported an issue [1] that with mmaped I/Os, sometimes the
> tail of the last page (after file ends) is not filled with zeroes.
> 
> The root cause is that such tail page could be wrongly selected for
> inplace I/Os so the zeroed part will then be filled with compressed
> data instead of zeroes.
> 
> A simple fix is to avoid doing inplace I/Os for such tail parts,
> actually that was already fixed upstream in commit e4c1cf523d82
> ("erofs: tidy up z_erofs_do_read_page()") by accident.
> 
> [1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com
> 
> Reported-by: keltargw <keltar.gw@gmail.com>
> Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
> ---
>  fs/erofs/zdata.c | 2 ++
>  1 file changed, 2 insertions(+)

All now queued up, thanks.

greg k-h

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

* Re: [PATCH 6.5.y] erofs: ensure that the post-EOF tails are all zeroed
@ 2023-09-02  8:19   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 23+ messages in thread
From: Greg Kroah-Hartman @ 2023-09-02  8:19 UTC (permalink / raw)
  To: Gao Xiang; +Cc: stable, linux-erofs, keltargw

On Thu, Aug 31, 2023 at 07:29:53PM +0800, Gao Xiang wrote:
> commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.
> 
> This was accidentally fixed up in commit e4c1cf523d82 but we can't
> take the full change due to other dependancy issues, so here is just
> the actual bugfix that is needed.
> 
> [Background]
> 
> keltargw reported an issue [1] that with mmaped I/Os, sometimes the
> tail of the last page (after file ends) is not filled with zeroes.
> 
> The root cause is that such tail page could be wrongly selected for
> inplace I/Os so the zeroed part will then be filled with compressed
> data instead of zeroes.
> 
> A simple fix is to avoid doing inplace I/Os for such tail parts,
> actually that was already fixed upstream in commit e4c1cf523d82
> ("erofs: tidy up z_erofs_do_read_page()") by accident.
> 
> [1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com
> 
> Reported-by: keltargw <keltar.gw@gmail.com>
> Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
> ---
>  fs/erofs/zdata.c | 2 ++
>  1 file changed, 2 insertions(+)

All now queued up, thanks.

greg k-h

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

* Patch "erofs: ensure that the post-EOF tails are all zeroed" has been added to the 5.10-stable tree
  2023-08-31 11:29   ` Gao Xiang
  (?)
  (?)
@ 2023-09-02  8:19   ` gregkh
  -1 siblings, 0 replies; 23+ messages in thread
From: gregkh @ 2023-09-02  8:19 UTC (permalink / raw)
  To: 3ad8b469-25db-a297-21f9-75db2d6ad224, gregkh, hsiangkao,
	keltar.gw, linux-erofs
  Cc: stable-commits


This is a note to let you know that I've just added the patch titled

    erofs: ensure that the post-EOF tails are all zeroed

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


From hsiangkao@linux.alibaba.com  Sat Sep  2 09:30:52 2023
From: Gao Xiang <hsiangkao@linux.alibaba.com>
Date: Thu, 31 Aug 2023 19:29:58 +0800
Subject: erofs: ensure that the post-EOF tails are all zeroed
To: stable@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-erofs@lists.ozlabs.org, Gao Xiang <hsiangkao@linux.alibaba.com>, keltargw <keltar.gw@gmail.com>
Message-ID: <20230831112959.99884-6-hsiangkao@linux.alibaba.com>

From: Gao Xiang <hsiangkao@linux.alibaba.com>

commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.

This was accidentally fixed up in commit e4c1cf523d82 but we can't
take the full change due to other dependancy issues, so here is just
the actual bugfix that is needed.

[Background]

keltargw reported an issue [1] that with mmaped I/Os, sometimes the
tail of the last page (after file ends) is not filled with zeroes.

The root cause is that such tail page could be wrongly selected for
inplace I/Os so the zeroed part will then be filled with compressed
data instead of zeroes.

A simple fix is to avoid doing inplace I/Os for such tail parts,
actually that was already fixed upstream in commit e4c1cf523d82
("erofs: tidy up z_erofs_do_read_page()") by accident.

[1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com

Reported-by: keltargw <keltar.gw@gmail.com>
Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/erofs/zdata.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -632,6 +632,8 @@ hitted:
 	cur = end - min_t(erofs_off_t, offset + end - map->m_la, end);
 	if (!(map->m_flags & EROFS_MAP_MAPPED)) {
 		zero_user_segment(page, cur, end);
+		++spiltted;
+		tight = false;
 		goto next_part;
 	}
 


Patches currently in stable-queue which might be from hsiangkao@linux.alibaba.com are

queue-5.10/erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch

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

* Patch "erofs: ensure that the post-EOF tails are all zeroed" has been added to the 5.15-stable tree
  2023-08-31 11:29   ` Gao Xiang
                     ` (2 preceding siblings ...)
  (?)
@ 2023-09-02  8:20   ` gregkh
  -1 siblings, 0 replies; 23+ messages in thread
From: gregkh @ 2023-09-02  8:20 UTC (permalink / raw)
  To: 3ad8b469-25db-a297-21f9-75db2d6ad224, gregkh, hsiangkao,
	keltar.gw, linux-erofs
  Cc: stable-commits


This is a note to let you know that I've just added the patch titled

    erofs: ensure that the post-EOF tails are all zeroed

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


From hsiangkao@linux.alibaba.com  Sat Sep  2 09:30:52 2023
From: Gao Xiang <hsiangkao@linux.alibaba.com>
Date: Thu, 31 Aug 2023 19:29:58 +0800
Subject: erofs: ensure that the post-EOF tails are all zeroed
To: stable@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-erofs@lists.ozlabs.org, Gao Xiang <hsiangkao@linux.alibaba.com>, keltargw <keltar.gw@gmail.com>
Message-ID: <20230831112959.99884-6-hsiangkao@linux.alibaba.com>

From: Gao Xiang <hsiangkao@linux.alibaba.com>

commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.

This was accidentally fixed up in commit e4c1cf523d82 but we can't
take the full change due to other dependancy issues, so here is just
the actual bugfix that is needed.

[Background]

keltargw reported an issue [1] that with mmaped I/Os, sometimes the
tail of the last page (after file ends) is not filled with zeroes.

The root cause is that such tail page could be wrongly selected for
inplace I/Os so the zeroed part will then be filled with compressed
data instead of zeroes.

A simple fix is to avoid doing inplace I/Os for such tail parts,
actually that was already fixed upstream in commit e4c1cf523d82
("erofs: tidy up z_erofs_do_read_page()") by accident.

[1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com

Reported-by: keltargw <keltar.gw@gmail.com>
Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/erofs/zdata.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -716,6 +716,8 @@ hitted:
 	cur = end - min_t(erofs_off_t, offset + end - map->m_la, end);
 	if (!(map->m_flags & EROFS_MAP_MAPPED)) {
 		zero_user_segment(page, cur, end);
+		++spiltted;
+		tight = false;
 		goto next_part;
 	}
 


Patches currently in stable-queue which might be from hsiangkao@linux.alibaba.com are

queue-5.15/erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch

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

* Patch "erofs: ensure that the post-EOF tails are all zeroed" has been added to the 6.1-stable tree
  2023-08-31 11:29   ` Gao Xiang
                     ` (3 preceding siblings ...)
  (?)
@ 2023-09-02  8:20   ` gregkh
  -1 siblings, 0 replies; 23+ messages in thread
From: gregkh @ 2023-09-02  8:20 UTC (permalink / raw)
  To: 3ad8b469-25db-a297-21f9-75db2d6ad224, gregkh, hsiangkao,
	keltar.gw, linux-erofs
  Cc: stable-commits


This is a note to let you know that I've just added the patch titled

    erofs: ensure that the post-EOF tails are all zeroed

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


From hsiangkao@linux.alibaba.com  Sat Sep  2 09:30:52 2023
From: Gao Xiang <hsiangkao@linux.alibaba.com>
Date: Thu, 31 Aug 2023 19:29:58 +0800
Subject: erofs: ensure that the post-EOF tails are all zeroed
To: stable@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-erofs@lists.ozlabs.org, Gao Xiang <hsiangkao@linux.alibaba.com>, keltargw <keltar.gw@gmail.com>
Message-ID: <20230831112959.99884-6-hsiangkao@linux.alibaba.com>

From: Gao Xiang <hsiangkao@linux.alibaba.com>

commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.

This was accidentally fixed up in commit e4c1cf523d82 but we can't
take the full change due to other dependancy issues, so here is just
the actual bugfix that is needed.

[Background]

keltargw reported an issue [1] that with mmaped I/Os, sometimes the
tail of the last page (after file ends) is not filled with zeroes.

The root cause is that such tail page could be wrongly selected for
inplace I/Os so the zeroed part will then be filled with compressed
data instead of zeroes.

A simple fix is to avoid doing inplace I/Os for such tail parts,
actually that was already fixed upstream in commit e4c1cf523d82
("erofs: tidy up z_erofs_do_read_page()") by accident.

[1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com

Reported-by: keltargw <keltar.gw@gmail.com>
Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/erofs/zdata.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -869,6 +869,8 @@ hitted:
 	cur = end - min_t(erofs_off_t, offset + end - map->m_la, end);
 	if (!(map->m_flags & EROFS_MAP_MAPPED)) {
 		zero_user_segment(page, cur, end);
+		++spiltted;
+		tight = false;
 		goto next_part;
 	}
 	if (map->m_flags & EROFS_MAP_FRAGMENT) {


Patches currently in stable-queue which might be from hsiangkao@linux.alibaba.com are

queue-6.1/erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch

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

* Patch "erofs: ensure that the post-EOF tails are all zeroed" has been added to the 6.4-stable tree
  2023-08-31 11:29   ` Gao Xiang
                     ` (4 preceding siblings ...)
  (?)
@ 2023-09-02  8:20   ` gregkh
  -1 siblings, 0 replies; 23+ messages in thread
From: gregkh @ 2023-09-02  8:20 UTC (permalink / raw)
  To: 3ad8b469-25db-a297-21f9-75db2d6ad224, gregkh, hsiangkao,
	keltar.gw, linux-erofs
  Cc: stable-commits


This is a note to let you know that I've just added the patch titled

    erofs: ensure that the post-EOF tails are all zeroed

to the 6.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch
and it can be found in the queue-6.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


From hsiangkao@linux.alibaba.com  Sat Sep  2 09:30:52 2023
From: Gao Xiang <hsiangkao@linux.alibaba.com>
Date: Thu, 31 Aug 2023 19:29:58 +0800
Subject: erofs: ensure that the post-EOF tails are all zeroed
To: stable@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-erofs@lists.ozlabs.org, Gao Xiang <hsiangkao@linux.alibaba.com>, keltargw <keltar.gw@gmail.com>
Message-ID: <20230831112959.99884-6-hsiangkao@linux.alibaba.com>

From: Gao Xiang <hsiangkao@linux.alibaba.com>

commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.

This was accidentally fixed up in commit e4c1cf523d82 but we can't
take the full change due to other dependancy issues, so here is just
the actual bugfix that is needed.

[Background]

keltargw reported an issue [1] that with mmaped I/Os, sometimes the
tail of the last page (after file ends) is not filled with zeroes.

The root cause is that such tail page could be wrongly selected for
inplace I/Os so the zeroed part will then be filled with compressed
data instead of zeroes.

A simple fix is to avoid doing inplace I/Os for such tail parts,
actually that was already fixed upstream in commit e4c1cf523d82
("erofs: tidy up z_erofs_do_read_page()") by accident.

[1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com

Reported-by: keltargw <keltar.gw@gmail.com>
Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/erofs/zdata.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -993,6 +993,8 @@ hitted:
 	cur = end - min_t(erofs_off_t, offset + end - map->m_la, end);
 	if (!(map->m_flags & EROFS_MAP_MAPPED)) {
 		zero_user_segment(page, cur, end);
+		++spiltted;
+		tight = false;
 		goto next_part;
 	}
 	if (map->m_flags & EROFS_MAP_FRAGMENT) {


Patches currently in stable-queue which might be from hsiangkao@linux.alibaba.com are

queue-6.4/erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch

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

* Patch "erofs: ensure that the post-EOF tails are all zeroed" has been added to the 6.5-stable tree
  2023-08-31 11:29   ` Gao Xiang
                     ` (5 preceding siblings ...)
  (?)
@ 2023-09-02  8:20   ` gregkh
  -1 siblings, 0 replies; 23+ messages in thread
From: gregkh @ 2023-09-02  8:20 UTC (permalink / raw)
  To: 3ad8b469-25db-a297-21f9-75db2d6ad224, gregkh, hsiangkao,
	keltar.gw, linux-erofs
  Cc: stable-commits


This is a note to let you know that I've just added the patch titled

    erofs: ensure that the post-EOF tails are all zeroed

to the 6.5-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch
and it can be found in the queue-6.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


From hsiangkao@linux.alibaba.com  Sat Sep  2 09:30:52 2023
From: Gao Xiang <hsiangkao@linux.alibaba.com>
Date: Thu, 31 Aug 2023 19:29:58 +0800
Subject: erofs: ensure that the post-EOF tails are all zeroed
To: stable@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-erofs@lists.ozlabs.org, Gao Xiang <hsiangkao@linux.alibaba.com>, keltargw <keltar.gw@gmail.com>
Message-ID: <20230831112959.99884-6-hsiangkao@linux.alibaba.com>

From: Gao Xiang <hsiangkao@linux.alibaba.com>

commit e4c1cf523d820730a86cae2c6d55924833b6f7ac upstream.

This was accidentally fixed up in commit e4c1cf523d82 but we can't
take the full change due to other dependancy issues, so here is just
the actual bugfix that is needed.

[Background]

keltargw reported an issue [1] that with mmaped I/Os, sometimes the
tail of the last page (after file ends) is not filled with zeroes.

The root cause is that such tail page could be wrongly selected for
inplace I/Os so the zeroed part will then be filled with compressed
data instead of zeroes.

A simple fix is to avoid doing inplace I/Os for such tail parts,
actually that was already fixed upstream in commit e4c1cf523d82
("erofs: tidy up z_erofs_do_read_page()") by accident.

[1] https://lore.kernel.org/r/3ad8b469-25db-a297-21f9-75db2d6ad224@linux.alibaba.com

Reported-by: keltargw <keltar.gw@gmail.com>
Fixes: 3883a79abd02 ("staging: erofs: introduce VLE decompression support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/erofs/zdata.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -1038,6 +1038,8 @@ hitted:
 	cur = end - min_t(erofs_off_t, offset + end - map->m_la, end);
 	if (!(map->m_flags & EROFS_MAP_MAPPED)) {
 		zero_user_segment(page, cur, end);
+		++spiltted;
+		tight = false;
 		goto next_part;
 	}
 	if (map->m_flags & EROFS_MAP_FRAGMENT) {


Patches currently in stable-queue which might be from hsiangkao@linux.alibaba.com are

queue-6.5/erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch

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

end of thread, other threads:[~2023-09-02  8:30 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-31 11:29 [PATCH 6.5.y] erofs: ensure that the post-EOF tails are all zeroed Gao Xiang
2023-08-31 11:29 ` Gao Xiang
2023-08-31 11:29 ` [PATCH 6.4.y] " Gao Xiang
2023-08-31 11:29   ` Gao Xiang
2023-08-31 11:29 ` [PATCH 6.1.y] " Gao Xiang
2023-08-31 11:29   ` Gao Xiang
2023-08-31 11:29 ` [PATCH 5.15.y] " Gao Xiang
2023-08-31 11:29   ` Gao Xiang
2023-08-31 11:29 ` [PATCH 5.10.y] " Gao Xiang
2023-08-31 11:29   ` Gao Xiang
2023-08-31 11:29 ` [PATCH 5.4.y] " Gao Xiang
2023-08-31 11:29   ` Gao Xiang
2023-09-02  8:19   ` Patch "erofs: ensure that the post-EOF tails are all zeroed" has been added to the 5.4-stable tree gregkh
2023-09-02  8:19   ` Patch "erofs: ensure that the post-EOF tails are all zeroed" has been added to the 5.10-stable tree gregkh
2023-09-02  8:20   ` Patch "erofs: ensure that the post-EOF tails are all zeroed" has been added to the 5.15-stable tree gregkh
2023-09-02  8:20   ` Patch "erofs: ensure that the post-EOF tails are all zeroed" has been added to the 6.1-stable tree gregkh
2023-09-02  8:20   ` Patch "erofs: ensure that the post-EOF tails are all zeroed" has been added to the 6.4-stable tree gregkh
2023-09-02  8:20   ` Patch "erofs: ensure that the post-EOF tails are all zeroed" has been added to the 6.5-stable tree gregkh
2023-08-31 11:29 ` [PATCH 4.19.y] erofs: ensure that the post-EOF tails are all zeroed Gao Xiang
2023-08-31 11:29   ` Gao Xiang
2023-09-02  8:19   ` Patch "erofs: ensure that the post-EOF tails are all zeroed" has been added to the 4.19-stable tree gregkh
2023-09-02  8:19 ` [PATCH 6.5.y] erofs: ensure that the post-EOF tails are all zeroed Greg Kroah-Hartman
2023-09-02  8:19   ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.