erofs: ensure that the post-EOF tails are all zeroed
Subsystems (3)
PATCH 1/1 erofs: ensure that the post-EOF tails are all zeroed
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/[email protected]
--- fs/erofs/zdata.c | 2 ++ 1 file changed, 2 insertions(+)
fs/erofs/zdata.c +2 -0
@@ -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 ) {
Signature · 1 line
2.24.4
PATCH 1/1 erofs: ensure that the post-EOF tails are all zeroed
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/[email protected]
--- fs/erofs/zdata.c | 2 ++ 1 file changed, 2 insertions(+)
fs/erofs/zdata.c +2 -0
@@ -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 ) {
Signature · 1 line
2.24.4
PATCH 1/1 erofs: ensure that the post-EOF tails are all zeroed
In reply to Gao Xiangcommit 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/[email protected]
--- fs/erofs/zdata.c | 2 ++ 1 file changed, 2 insertions(+)
fs/erofs/zdata.c +2 -0
@@ -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 ) {
Signature · 1 line
2.24.4
PATCH 1/1 erofs: ensure that the post-EOF tails are all zeroed
In reply to Gao Xiangcommit 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/[email protected]
--- fs/erofs/zdata.c | 2 ++ 1 file changed, 2 insertions(+)
fs/erofs/zdata.c +2 -0
@@ -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; }
Signature · 1 line
2.24.4
PATCH 1/1 erofs: ensure that the post-EOF tails are all zeroed
In reply to Gao Xiangcommit 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/[email protected]
--- fs/erofs/zdata.c | 2 ++ 1 file changed, 2 insertions(+)
fs/erofs/zdata.c +2 -0
@@ -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; }
Signature · 1 line
2.24.4
PATCH 1/1 erofs: ensure that the post-EOF tails are all zeroed
In reply to Gao Xiangcommit 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/[email protected]
--- fs/erofs/zdata.c | 2 ++ 1 file changed, 2 insertions(+)
fs/erofs/zdata.c +2 -0
@@ -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; }
Signature · 1 line
2.24.4
Patch "erofs: ensure that the post-EOF tails are all zeroed" has been added to the 5.10-stable tree
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 <[email protected]> know about it.
From [email protected] Sat Sep 2 09:30:52 2023
From: Gao Xiang <[email protected]>
Date: Thu, 31 Aug 2023 19:29:58 +0800
Subject: erofs: ensure that the post-EOF tails are all zeroed
To: [email protected], Greg Kroah-Hartman <[email protected]>
Cc: [email protected], Gao Xiang <[email protected]>, keltargw <[email protected]>
Message-ID: <[email protected]>
From: Gao Xiang <[email protected]>
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/[email protected]
--- fs/erofs/zdata.c | 2 ++ 1 file changed, 2 insertions(+)
fs/erofs/zdata.c +2 -0
@@ -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 [email protected] are
queue-5.10/erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch
Patch "erofs: ensure that the post-EOF tails are all zeroed" has been added to the 6.1-stable tree
In reply to Gao XiangThis 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 <[email protected]> know about it.
From [email protected] Sat Sep 2 09:30:52 2023
From: Gao Xiang <[email protected]>
Date: Thu, 31 Aug 2023 19:29:58 +0800
Subject: erofs: ensure that the post-EOF tails are all zeroed
To: [email protected], Greg Kroah-Hartman <[email protected]>
Cc: [email protected], Gao Xiang <[email protected]>, keltargw <[email protected]>
Message-ID: <[email protected]>
From: Gao Xiang <[email protected]>
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/[email protected]
--- fs/erofs/zdata.c | 2 ++ 1 file changed, 2 insertions(+)
fs/erofs/zdata.c +2 -0
@@ -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 [email protected] are
queue-6.1/erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch
Patch "erofs: ensure that the post-EOF tails are all zeroed" has been added to the 5.4-stable tree
In reply to Gao XiangThis 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 <[email protected]> know about it.
From [email protected] Sat Sep 2 09:30:52 2023
From: Gao Xiang <[email protected]>
Date: Thu, 31 Aug 2023 19:29:58 +0800
Subject: erofs: ensure that the post-EOF tails are all zeroed
To: [email protected], Greg Kroah-Hartman <[email protected]>
Cc: [email protected], Gao Xiang <[email protected]>, keltargw <[email protected]>
Message-ID: <[email protected]>
From: Gao Xiang <[email protected]>
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/[email protected]
--- fs/erofs/zdata.c | 2 ++ 1 file changed, 2 insertions(+)
fs/erofs/zdata.c +2 -0
@@ -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 [email protected] are
queue-5.4/erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch
Patch "erofs: ensure that the post-EOF tails are all zeroed" has been added to the 5.15-stable tree
In reply to Gao XiangThis 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 <[email protected]> know about it.
From [email protected] Sat Sep 2 09:30:52 2023
From: Gao Xiang <[email protected]>
Date: Thu, 31 Aug 2023 19:29:58 +0800
Subject: erofs: ensure that the post-EOF tails are all zeroed
To: [email protected], Greg Kroah-Hartman <[email protected]>
Cc: [email protected], Gao Xiang <[email protected]>, keltargw <[email protected]>
Message-ID: <[email protected]>
From: Gao Xiang <[email protected]>
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/[email protected]
--- fs/erofs/zdata.c | 2 ++ 1 file changed, 2 insertions(+)
fs/erofs/zdata.c +2 -0
@@ -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 [email protected] are
queue-5.15/erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch
Patch "erofs: ensure that the post-EOF tails are all zeroed" has been added to the 6.5-stable tree
In reply to Gao XiangThis 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 <[email protected]> know about it.
From [email protected] Sat Sep 2 09:30:52 2023
From: Gao Xiang <[email protected]>
Date: Thu, 31 Aug 2023 19:29:58 +0800
Subject: erofs: ensure that the post-EOF tails are all zeroed
To: [email protected], Greg Kroah-Hartman <[email protected]>
Cc: [email protected], Gao Xiang <[email protected]>, keltargw <[email protected]>
Message-ID: <[email protected]>
From: Gao Xiang <[email protected]>
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/[email protected]
--- fs/erofs/zdata.c | 2 ++ 1 file changed, 2 insertions(+)
fs/erofs/zdata.c +2 -0
@@ -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 [email protected] are
queue-6.5/erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch
Patch "erofs: ensure that the post-EOF tails are all zeroed" has been added to the 6.4-stable tree
In reply to Gao XiangThis 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 <[email protected]> know about it.
From [email protected] Sat Sep 2 09:30:52 2023
From: Gao Xiang <[email protected]>
Date: Thu, 31 Aug 2023 19:29:58 +0800
Subject: erofs: ensure that the post-EOF tails are all zeroed
To: [email protected], Greg Kroah-Hartman <[email protected]>
Cc: [email protected], Gao Xiang <[email protected]>, keltargw <[email protected]>
Message-ID: <[email protected]>
From: Gao Xiang <[email protected]>
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/[email protected]
--- fs/erofs/zdata.c | 2 ++ 1 file changed, 2 insertions(+)
fs/erofs/zdata.c +2 -0
@@ -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 [email protected] are
queue-6.4/erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch
PATCH 1/1 erofs: ensure that the post-EOF tails are all zeroed
In reply to Gao Xiangcommit 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/[email protected]
--- drivers/staging/erofs/unzip_vle.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/staging/erofs/unzip_vle.c +2 -0
@@ -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; }
Signature · 1 line
2.24.4
Patch "erofs: ensure that the post-EOF tails are all zeroed" has been added to the 4.19-stable tree
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 <[email protected]> know about it.
From [email protected] Sat Sep 2 10:18:30 2023
From: Gao Xiang <[email protected]>
Date: Thu, 31 Aug 2023 19:29:59 +0800
Subject: erofs: ensure that the post-EOF tails are all zeroed
To: [email protected], Greg Kroah-Hartman <[email protected]>
Cc: [email protected], Gao Xiang <[email protected]>, keltargw <[email protected]>
Message-ID: <[email protected]>
From: Gao Xiang <[email protected]>
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/[email protected]
--- drivers/staging/erofs/unzip_vle.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/staging/erofs/unzip_vle.c +2 -0
@@ -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 [email protected] are
queue-4.19/erofs-ensure-that-the-post-eof-tails-are-all-zeroed.patch
Greg Kroah-Hartman
maintainerQuoted 19 lines · Gao Xiang
commit
e4c1cf523d820730a86cae2c6d55924833b6f7acupstream.This was accidentally fixed up in commit
e4c1cf523d82but 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 upz_erofs_do_read_page()") by accident.
Quoted 8 lines
[1] https://lore.kernel.org/r/[email protected]
Reported-by keltargw <[email protected]>Fixes 3883a79abd02 ("staging: erofs: introduce VLE decompression support")Signed-off-by Gao Xiang <[email protected]>--- fs/erofs/zdata.c | 2 ++ 1 file changed, 2 insertions(+)
All now queued up, thanks.
greg k-h