summaryrefslogtreecommitdiff
path: root/fs/zonefs
diff options
context:
space:
mode:
authorDamien Le Moal <damien.lemoal@opensource.wdc.com>2022-05-24 08:29:39 +0900
committerDamien Le Moal <damien.lemoal@opensource.wdc.com>2022-05-24 17:06:45 +0900
commit14bdb047a54d7a44af8633848ad097bbaf1b2cb6 (patch)
treea0194e6cc3af814f6d62ddcc4002614f661931ad /fs/zonefs
parent143a6252e1b8ab424b4b293512a97cca7295c182 (diff)
zonefs: Fix zonefs_init_file_inode() return value
Commit 87c9ce3ffec9 ("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: 87c9ce3ffec9 ("zonefs: Add active seq file accounting") Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Diffstat (limited to 'fs/zonefs')
-rw-r--r--fs/zonefs/super.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
index b3b0b71fdf6c..652752df1a2f 100644
--- a/fs/zonefs/super.c
+++ b/fs/zonefs/super.c
@@ -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,