Skip to contentSkip to conversation

udf: use common error code for unclean filesystem

PATCH In review Pavel Machek 2 participants 2 messages Jul 26, 2020 – Jul 27, 2020 UDF filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 udf: use common error code for unclean filesystem

Use common error code for unclean filesystem, and warn when incosistency is detected.

fs/udf/inode.c +4 -1
index adaba8e8b326..8e74c7b5b8d0 100644
@@ -1395,7 +1395,10 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode)
 	if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_SHORT &&
 	    iinfo->i_alloc_type != ICBTAG_FLAG_AD_LONG &&
 	    iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) {
-		ret = -EIO;
+		ret = -EUCLEAN;
+		udf_err(inode->i_sb, "invalid allocation type: %u\n",
+			iinfo->i_alloc_type);
+
 		goto out;
 	}
 	iinfo->i_unique = 0;
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#1 lore raw
Quoted 5 lines · Pavel Machek

Use common error code for unclean filesystem, and warn when incosistency is detected.

So this is going in the right direction but there are *much* more places that would need a similar treatment (furthermore I'd prefer to use the EFSCORRUPTED redefine of EUCLEAN as other filesystems do). Any reason why you converted this particular place?

Honza

Quoted 21 lines
fs/udf/inode.c +4 -1
index adaba8e8b326..8e74c7b5b8d0 100644
@@ -1395,7 +1395,10 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode)
 	if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_SHORT &&
 	    iinfo->i_alloc_type != ICBTAG_FLAG_AD_LONG &&
 	    iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) {
-		ret = -EIO;
+		ret = -EUCLEAN;
+		udf_err(inode->i_sb, "invalid allocation type: %u\n",
+			iinfo->i_alloc_type);
+
 		goto out;
 	}
 	iinfo->i_unique = 0;
Signature · 3 lines
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR