From: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
To: linux-ext4@vger.kernel.org
Cc: tytso@mit.edu, Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Subject: [PATCH 1/4] e2fsck: don't ignore return values in e2fsck_rewrite_extent_tree
Date: Fri, 19 Feb 2021 13:03:30 -0800 [thread overview]
Message-ID: <20210219210333.1439525-1-harshads@google.com> (raw)
From: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Don't ignore return values of ext2fs_read/write_inode_full() in
e2fsck_rewrite_extent_tree.
Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
---
e2fsck/extents.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/e2fsck/extents.c b/e2fsck/extents.c
index 600dbc97..f48f14ff 100644
--- a/e2fsck/extents.c
+++ b/e2fsck/extents.c
@@ -290,8 +290,10 @@ errcode_t e2fsck_rewrite_extent_tree(e2fsck_t ctx, struct extent_list *list)
errcode_t err;
memset(&inode, 0, sizeof(inode));
- ext2fs_read_inode_full(ctx->fs, list->ino, EXT2_INODE(&inode),
- sizeof(inode));
+ err = ext2fs_read_inode_full(ctx->fs, list->ino, EXT2_INODE(&inode),
+ sizeof(inode));
+ if (err)
+ return err;
/* Skip deleted inodes and inline data files */
if (inode.i_flags & EXT4_INLINE_DATA_FL)
@@ -306,10 +308,8 @@ errcode_t e2fsck_rewrite_extent_tree(e2fsck_t ctx, struct extent_list *list)
if (err)
return err;
ext2fs_iblk_set(ctx->fs, EXT2_INODE(&inode), blk_count);
- ext2fs_write_inode_full(ctx->fs, list->ino, EXT2_INODE(&inode),
- sizeof(inode));
-
- return 0;
+ return ext2fs_write_inode_full(ctx->fs, list->ino, EXT2_INODE(&inode),
+ sizeof(inode));
}
errcode_t e2fsck_read_extents(e2fsck_t ctx, struct extent_list *extents)
--
2.30.0.617.g56c4b15f3c-goog
next reply other threads:[~2021-02-19 21:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-19 21:03 Harshad Shirwadkar [this message]
2021-02-19 21:03 ` [PATCH 2/4] ext2fs: don't ignore return value in ext2fs_count_blocks Harshad Shirwadkar
2021-02-19 21:03 ` [PATCH 3/4] e2fsck: add fallthrough comment in fc replay switch case Harshad Shirwadkar
2021-02-19 21:03 ` [PATCH 4/4] e2fsck: initialize variable before first use in fast commit replay Harshad Shirwadkar
2021-02-21 23:14 ` Theodore Ts'o
2021-02-23 17:41 ` harshad shirwadkar
2021-02-20 8:58 ` [PATCH 1/4] e2fsck: don't ignore return values in e2fsck_rewrite_extent_tree Благодаренко Артём
2021-02-23 17:40 ` harshad shirwadkar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210219210333.1439525-1-harshads@google.com \
--to=harshadshirwadkar@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.