udf: propagate error from udf_fiiter_add_entry
PATCH 1/1 udf: propagate error from udf_fiiter_add_entry
From: Tristan Madani <[email protected]>
udf_fiiter_add_entry() triggers a WARN when it encounters an error condition but does not propagate the error to callers. This can be triggered by a corrupted filesystem image.
Replace the WARN with proper error propagation to allow callers to handle the failure gracefully.
--- fs/udf/namei.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
fs/udf/namei.c +1 -6
@@ -207,14 +207,9 @@ static int udf_expand_dir_adinicb(struct inode *inode, udf_pblk_t *block)udf_fiiter_write_fi (&iter, impuse); }brelse (dbh); -/* -* We don't expect the iteration to fail as the directory has been -* already verified to be correct -*/ -WARN_ON_ONCE (ret);udf_fiiter_release (&iter); -return 0 ; +return ret; } static int udf_fiiter_add_entry(struct inode *dir, struct dentry *dentry,
Signature · 1 line
2.47.3
Quoted 6 lines · Tristan Madani
From: Tristan Madani <[email protected]>
udf_fiiter_add_entry()triggers a WARN when it encounters an error condition but does not propagate the error to callers. This can be triggered by a corrupted filesystem image.
Quoted 6 lines
Replace the WARN with proper error propagation to allow callers to handle the failure gracefully.
Thanks for the patch. Did you analyze how it happened that the directory iteration fixing up tags failed? Because if it fails like this, we have practically wiped the directory which is not great. So if we are missing some directory consistency check before we start converting it, it would be good to add it instead of just failing like this later.
Honza
Quoted 27 lines
--- fs/udf/namei.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)fs/udf/namei.c +1
-6@@ -207,14 +207,9 @@ static int udf_expand_dir_adinicb(struct inode *inode, udf_pblk_t *block)udf_fiiter_write_fi (&iter, impuse); }brelse (dbh); -/* -* We don't expect the iteration to fail as the directory has been -* already verified to be correct -*/ -WARN_ON_ONCE (ret);udf_fiiter_release (&iter); -return 0 ; +return ret; } static int udf_fiiter_add_entry(struct inode *dir, struct dentry *dentry,Signature · 1 line
2.47.3
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR