File tree Expand file tree Collapse file tree
kernel/crates/another_ext4/src/ext4 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,9 +44,12 @@ fn unsupported_orphan_format(sb: &SuperBlock) -> bool {
4444 unsupported_orphan_features ( sb. compatible_features ( ) , sb. read_only_compatible_features ( ) )
4545}
4646
47- fn unsupported_orphan_features ( compatible : u32 , read_only_compatible : u32 ) -> bool {
48- compatible & SuperBlock :: FEATURE_COMPAT_ORPHAN_FILE != 0
49- || read_only_compatible & SuperBlock :: FEATURE_RO_COMPAT_ORPHAN_PRESENT != 0
47+ fn unsupported_orphan_features ( _compatible : u32 , read_only_compatible : u32 ) -> bool {
48+ // FEATURE_COMPAT_ORPHAN_FILE is a *compat* feature: kernels without orphan-file
49+ // support can still mount read-write and simply ignore the dedicated orphan inode.
50+ // Reject only when ORPHAN_PRESENT is set, which means there are actual unrecovered
51+ // orphans in the orphan file that this implementation cannot process.
52+ read_only_compatible & SuperBlock :: FEATURE_RO_COMPAT_ORPHAN_PRESENT != 0
5053}
5154
5255fn valid_orphan_number < R : LegacyOrphanReader > ( reader : & R , inode : InodeId ) -> bool {
@@ -395,7 +398,7 @@ mod tests {
395398 #[ test]
396399 fn preflight_rejects_each_orphan_file_feature ( ) {
397400 assert ! ( !unsupported_orphan_features( 0 , 0 ) ) ;
398- assert ! ( unsupported_orphan_features(
401+ assert ! ( ! unsupported_orphan_features(
399402 SuperBlock :: FEATURE_COMPAT_ORPHAN_FILE ,
400403 0
401404 ) ) ;
You can’t perform that action at this time.
0 commit comments