Skip to content

Commit 4243bf8

Browse files
alexhenriejankara
authored andcommitted
isofs: handle CDs with bad root inode but good Joliet root directory
I have a CD copy of the original Tom Clancy's Ghost Recon game from 2001. The disc mounts without error on Windows, but on Linux mounting fails with the message "isofs_fill_super: get root inode failed". The error originates in isofs_read_inode, which returns -EIO because de_len is 0. The superblock on this disc appears to be intentionally corrupt as a form of copy protection. When the root inode is unusable, instead of giving up immediately, try to continue with the Joliet file table. This fixes the Ghost Recon CD and probably other copy-protected CDs too. Signed-off-by: Alex Henrie <alexhenrie24@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz> Message-Id: <20240208022134.451490-1-alexhenrie24@gmail.com>
1 parent c8f1140 commit 4243bf8

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

fs/isofs/inode.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -908,8 +908,22 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
908908
* we then decide whether to use the Joliet descriptor.
909909
*/
910910
inode = isofs_iget(s, sbi->s_firstdatazone, 0);
911-
if (IS_ERR(inode))
912-
goto out_no_root;
911+
912+
/*
913+
* Fix for broken CDs with a corrupt root inode but a correct Joliet
914+
* root directory.
915+
*/
916+
if (IS_ERR(inode)) {
917+
if (joliet_level && sbi->s_firstdatazone != first_data_zone) {
918+
printk(KERN_NOTICE
919+
"ISOFS: root inode is unusable. "
920+
"Disabling Rock Ridge and switching to Joliet.");
921+
sbi->s_rock = 0;
922+
inode = NULL;
923+
} else {
924+
goto out_no_root;
925+
}
926+
}
913927

914928
/*
915929
* Fix for broken CDs with Rock Ridge and empty ISO root directory but

0 commit comments

Comments
 (0)