Skip to content

Commit 66a362a

Browse files
baryonixAl Viro
authored andcommitted
isofs: Fix lseek() to position beyond 4 GB
isofs supports files larger than 4 GB by using multi-extent files. However an lseek() to a position beyond 4 GB in such a file will fail with EINVAL, because s_maxbytes in the isofs superblock is initialized to 2^32-1, and generic_file_llseek() checks against that value. I therefore suggest increasing the value of s_maxbytes to have full support for large files in isofs. With multi-extent files, file size is only limited by the maximum size of the file system (8 TB), so this seems a reasonable value for s_maxbytes. Signed-off-by: Jan Andres <jandres@gmx.net> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 532490f commit 66a362a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎fs/isofs/inode.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,12 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
722722
}
723723

724724
s->s_magic = ISOFS_SUPER_MAGIC;
725-
s->s_maxbytes = 0xffffffff; /* We can handle files up to 4 GB */
725+
726+
/*
727+
* With multi-extent files, file size is only limited by the maximum
728+
* size of a file system, which is 8 TB.
729+
*/
730+
s->s_maxbytes = 0x80000000000LL;
726731

727732
/*
728733
* The CDROM is read-only, has no nodes (devices) on it, and since

0 commit comments

Comments
 (0)