Skip to content

Commit

Permalink
isofs: Fix lseek() to position beyond 4 GB
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jan Andres authored and Al Viro committed Aug 11, 2010
1 parent 532490f commit 66a362a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fs/isofs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,12 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
}

s->s_magic = ISOFS_SUPER_MAGIC;
s->s_maxbytes = 0xffffffff; /* We can handle files up to 4 GB */

/*
* With multi-extent files, file size is only limited by the maximum
* size of a file system, which is 8 TB.
*/
s->s_maxbytes = 0x80000000000LL;

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

0 comments on commit 66a362a

Please sign in to comment.