From 01db417e0aee3e51df4f5f3775535fd1fb15e329 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 8 May 2024 19:45:30 +0200 Subject: Merging upstream version 5.10.216. Signed-off-by: Daniel Baumann --- fs/isofs/inode.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'fs/isofs') diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index f62b5a501..4c763f573 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c @@ -907,8 +907,22 @@ root_found: * we then decide whether to use the Joliet descriptor. */ inode = isofs_iget(s, sbi->s_firstdatazone, 0); - if (IS_ERR(inode)) - goto out_no_root; + + /* + * Fix for broken CDs with a corrupt root inode but a correct Joliet + * root directory. + */ + if (IS_ERR(inode)) { + if (joliet_level && sbi->s_firstdatazone != first_data_zone) { + printk(KERN_NOTICE + "ISOFS: root inode is unusable. " + "Disabling Rock Ridge and switching to Joliet."); + sbi->s_rock = 0; + inode = NULL; + } else { + goto out_no_root; + } + } /* * Fix for broken CDs with Rock Ridge and empty ISO root directory but -- cgit v1.2.3