Skip to contentSkip to conversation

ext4: remove useless resetting io_end_size in mpage_process_page()

PATCH In review Nghia Le 2 participants 3 messages Oct 21, 2021 – Oct 25, 2021 ext4 file system

lore
Share & tools
lore

Nghia Le

author
#0 lore raw

PATCH v2 1/1 ext4: remove useless resetting io_end_size in mpage_process_page()

The command "make clang-analyzer" detects dead stores.

Do not reset io_end_size to 0 in the current paths, as the function exists on those paths wihout further using io_end_sized.

---
 fs/ext4/inode.c | 2 --
 1 file changed, 2 deletions(-)
fs/ext4/inode.c +0 -2
index 0f06305167d5..03efed2ed1ea 100644
@@ -2260,7 +2260,6 @@ static int mpage_process_page(struct mpage_da_data *mpd, struct page *page,
 			mpd->map.m_len = 0;
 			mpd->map.m_flags = 0;
 			io_end_vec->size += io_end_size;
-			io_end_size = 0;
 
 			err = mpage_process_page_bufs(mpd, head, bh, lblk);
 			if (err > 0)
@@ -2285,7 +2284,6 @@ static int mpage_process_page(struct mpage_da_data *mpd, struct page *page,
 	} while (lblk++, (bh = bh->b_this_page) != head);
 
 	io_end_vec->size += io_end_size;
-	io_end_size = 0;
 	*map_bh = false;
 out:
 	*m_lblk = lblk;
Signature · 11 lines
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#254): https://lists.elisa.tech/g/linux-safety/message/254
Mute This Topic: https://lists.elisa.tech/mt/86495840/5278000
Group Owner: [email protected]
Unsubscribe: https://lists.elisa.tech/g/linux-safety/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
#1 lore raw
Quoted 2 lines · Nghia Le

The command "make clang-analyzer" detects dead stores.

maybe mention that it detects dead stores in mpage_process_page().

Quoted 3 lines

Do not reset io_end_size to 0 in the current paths, as the function exists on those paths wihout further using io_end_sized.

just a few typo:

s/exists/exits/
s/wihout/without/
s/io_end_sized/io_end_size/

So far it looks good. Can you correct those minor points above and then we should be fine...

Lukas

Quoted 27 lines
---
 fs/ext4/inode.c | 2 --
 1 file changed, 2 deletions(-)
fs/ext4/inode.c +0 -3
index 0f06305167d5..03efed2ed1ea 100644
@@ -2260,7 +2260,6 @@ static int mpage_process_page(struct mpage_da_data *mpd, struct page *page,
                        mpd->map.m_len = 0;
                        mpd->map.m_flags = 0;
                        io_end_vec->size += io_end_size;
-                       io_end_size = 0;
 
                        err = mpage_process_page_bufs(mpd, head, bh, lblk);
                        if (err > 0)
@@ -2285,7 +2284,6 @@ static int mpage_process_page(struct mpage_da_data *mpd, struct page *page,
        } while (lblk++, (bh = bh->b_this_page) != head);
 
        io_end_vec->size += io_end_size;
-       io_end_size = 0;
        *map_bh = false;
 out:
        *m_lblk = lblk;
--
Quoted 2 lines

2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#256): https://lists.elisa.tech/g/linux-safety/message/256
Mute This Topic: https://lists.elisa.tech/mt/86495840/5278000
Group Owner: [email protected]
Unsubscribe: https://lists.elisa.tech/g/linux-safety/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

author
#2 lore raw

Hi Lukas,
Thanks a lot for your comments, I fixed typos and submitted patch to public mailing list.
Best regards,
Nghia Le

Quoted 54 lines · Lukas Bulwahn
Quoted 2 lines · Nghia Le

The command "make clang-analyzer" detects dead stores.

maybe mention that it detects dead stores in mpage_process_page().

Quoted 3 lines

Do not reset io_end_size to 0 in the current paths, as the function exists on those paths wihout further using io_end_sized.

just a few typo:

s/exists/exits/
s/wihout/without/
s/io_end_sized/io_end_size/

So far it looks good. Can you correct those minor points above and then we should be fine...

Lukas

fs/ext4/inode.c static int mpage_process_page(struct mpage_da_data

Quoted 11 lines
---
 fs/ext4/inode.c | 2 --
 1 file changed, 2 deletions(-)
fs/ext4/inode.c +0 -0
index 0f06305167d5..03efed2ed1ea 100644
@@ -2260,7 +2260,6 @@ static int mpage_process_page(struct mpage_da_data

*mpd, struct page *page,

fs/ext4/inode.c static int mpage_process_page(struct mpage_da_data *mpd, struct page *page,

Quoted 6 lines
fs/ext4/inode.c +0 -1
                        mpd->map.m_len = 0;
                        mpd->map.m_flags = 0;
                        io_end_vec->size += io_end_size;
-                       io_end_size = 0;
 
                        err = mpage_process_page_bufs(mpd, head, bh,

lblk);

fs/ext4/inode.c static int mpage_process_page(struct mpage_da_data

Quoted 2 lines
fs/ext4/inode.c +0 -0
                        if (err > 0)
@@ -2285,7 +2284,6 @@ static int mpage_process_page(struct mpage_da_data

*mpd, struct page *page,

Quoted 10 lines
fs/ext4/inode.c +0 -2
        } while (lblk++, (bh = bh->b_this_page) != head);
 
        io_end_vec->size += io_end_size;
-       io_end_size = 0;
        *map_bh = false;
 out:
        *m_lblk = lblk;
--

2.25.1