From bbbcd6d5b2a7f8d9983c58dd5401243212eedaf8 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 12 May 2018 11:40:08 -0400 Subject: [PATCH] add patch fix-wrong-return-value-in-ext4_read_inode_bitmap --- fix-wrong-return-value-in-ext4_read_inode_bitmap | 31 ++++++++++++++++++++++++ series | 1 + timestamps | 7 +++--- 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 fix-wrong-return-value-in-ext4_read_inode_bitmap diff --git a/fix-wrong-return-value-in-ext4_read_inode_bitmap b/fix-wrong-return-value-in-ext4_read_inode_bitmap new file mode 100644 index 00000000..5b2bcf03 --- /dev/null +++ b/fix-wrong-return-value-in-ext4_read_inode_bitmap @@ -0,0 +1,31 @@ +ext4: fix wrong return value in ext4_read_inode_bitmap() + +From: Wang Shilong + +The only reason that sb_getblk() could fail is out of memory, +ext4 codes have returned -ENOMME for all other places except this +one, let's fix it here too. + +Signed-off-by: Wang Shilong +Signed-off-by: Theodore Ts'o +--- + fs/ext4/ialloc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c +index df92e3ec9913..33a2c98ce1ff 100644 +--- a/fs/ext4/ialloc.c ++++ b/fs/ext4/ialloc.c +@@ -143,7 +143,7 @@ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group) + ext4_error(sb, "Cannot read inode bitmap - " + "block_group = %u, inode_bitmap = %llu", + block_group, bitmap_blk); +- return ERR_PTR(-EIO); ++ return ERR_PTR(-ENOMEM); + } + if (bitmap_uptodate(bh)) + goto verify; +-- +2.14.3 + + diff --git a/series b/series index e06a23e4..d09890d8 100644 --- a/series +++ b/series @@ -3,6 +3,7 @@ make-ext4_getfsmap_find_fixed_metadata-static use-XATTR_CREATE-in-ext4_initxattrs use-raw_iversion-value-for-ea_inode +fix-wrong-return-value-in-ext4_read_inode_bitmap #################################################### # unstable patches diff --git a/timestamps b/timestamps index 6e60ffde..44d33aab 100755 --- a/timestamps +++ b/timestamps @@ -36,7 +36,8 @@ touch -d @1523242125 add-ext4-journal-lazy-mount-option touch -d @1525967404 make-ext4_getfsmap_find_fixed_metadata-static touch -d @1525967534 use-XATTR_CREATE-in-ext4_initxattrs touch -d @1525967731 use-raw_iversion-value-for-ea_inode -touch -d @1525967755 series touch -d @1525967791 stable-boundary -touch -d @1526139068 status -touch -d @1526139318 timestamps +touch -d @1526139301 fix-wrong-return-value-in-ext4_read_inode_bitmap +touch -d @1526139360 series +touch -d @1526139365 status +touch -d @1526139598 timestamps -- 2.11.4.GIT