Commit 27d7c4ed authored by Jan Kara's avatar Jan Kara Committed by Theodore Ts'o

ext4: silence warning in ext4_writepages()

The loop in mpage_map_and_submit_extent() is guaranteed to always run
at least once since the caller of mpage_map_and_submit_extent() makes
sure map->m_len > 0. So make that explicit using do-while instead of
pure while which also silences the compiler warning about
uninitialized 'err' variable.
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: default avatarLukas Czerner <lczerner@redhat.com>
parent 6ae06ff5
...@@ -2163,7 +2163,7 @@ static int mpage_map_and_submit_extent(handle_t *handle, ...@@ -2163,7 +2163,7 @@ static int mpage_map_and_submit_extent(handle_t *handle,
mpd->io_submit.io_end->offset = mpd->io_submit.io_end->offset =
((loff_t)map->m_lblk) << inode->i_blkbits; ((loff_t)map->m_lblk) << inode->i_blkbits;
while (map->m_len) { do {
err = mpage_map_one_extent(handle, mpd); err = mpage_map_one_extent(handle, mpd);
if (err < 0) { if (err < 0) {
struct super_block *sb = inode->i_sb; struct super_block *sb = inode->i_sb;
...@@ -2201,7 +2201,7 @@ static int mpage_map_and_submit_extent(handle_t *handle, ...@@ -2201,7 +2201,7 @@ static int mpage_map_and_submit_extent(handle_t *handle,
err = mpage_map_and_submit_buffers(mpd); err = mpage_map_and_submit_buffers(mpd);
if (err < 0) if (err < 0)
return err; return err;
} } while (map->m_len);
/* Update on-disk size after IO is submitted */ /* Update on-disk size after IO is submitted */
disksize = ((loff_t)mpd->first_page) << PAGE_CACHE_SHIFT; disksize = ((loff_t)mpd->first_page) << PAGE_CACHE_SHIFT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment