[PATCH] ext4: correct error handling of ext4_get_journal_inode()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Zhang Yi <yi.zhang@xxxxxxxxxx>

Commit '99d6c5d892bf ("ext4: ext4_get_{dev}_journal return proper error
value")' changed ext4_get_journal_inode() to return error return value
when something bad happened, but missed to modify the caller
ext4_calculate_overhead(), so fix it.

Reported-by: syzbot+b3123e6d9842e526de39@xxxxxxxxxxxxxxxxxxxxxxxxx
Fixes: 99d6c5d892bf ("ext4: ext4_get_{dev}_journal return proper error value")
Signed-off-by: Zhang Yi <yi.zhang@xxxxxxxxxx>
---
 fs/ext4/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index bb42525de8d0..91f20afa1d71 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4260,7 +4260,7 @@ int ext4_calculate_overhead(struct super_block *sb)
 	else if (ext4_has_feature_journal(sb) && !sbi->s_journal && j_inum) {
 		/* j_inum for internal journal is non-zero */
 		j_inode = ext4_get_journal_inode(sb, j_inum);
-		if (j_inode) {
+		if (!IS_ERR(j_inode)) {
 			j_blocks = j_inode->i_size >> sb->s_blocksize_bits;
 			overhead += EXT4_NUM_B2C(sbi, j_blocks);
 			iput(j_inode);
-- 
2.39.2




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux