zonefs: Fix zonefs_init_file_inode() return value

Commit 87c9ce3ffe ("zonefs: Add active seq file accounting") wrongly
changed zonefs_init_file_inode() to always return 0 even if the call to
zonefs_zone_mgmt() fails. Fix this by propagating zonefs_zone_mgmt()
return value as the return value for zonefs_init_file_inode().

Fixes: 87c9ce3ffe ("zonefs: Add active seq file accounting")
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
This commit is contained in:
Damien Le Moal 2022-05-24 08:29:39 +09:00
parent 143a6252e1
commit 14bdb047a5

View File

@ -1373,7 +1373,7 @@ static int zonefs_init_file_inode(struct inode *inode, struct blk_zone *zone,
struct super_block *sb = inode->i_sb;
struct zonefs_sb_info *sbi = ZONEFS_SB(sb);
struct zonefs_inode_info *zi = ZONEFS_I(inode);
int ret;
int ret = 0;
inode->i_ino = zone->start >> sbi->s_zone_sectors_shift;
inode->i_mode = S_IFREG | sbi->s_perm;
@ -1420,7 +1420,7 @@ static int zonefs_init_file_inode(struct inode *inode, struct blk_zone *zone,
unlock:
mutex_unlock(&zi->i_truncate_mutex);
return 0;
return ret;
}
static struct dentry *zonefs_create_inode(struct dentry *parent,