large offset llseek breaks for device special files on ac series
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 large offset llseek breaks for device special files on ac series
Dear all,
The ac-kernel series include a check in default_llseek() to not set the file position beyond the file systems maximum file size.
This check should be done only for regular files, e.g. for a device special file the test does not make sense.
Alan suggested that we remove the check from the default_llseek method and introduce a generic_file_llseek() method that checks the maximum file size. The generic_file_llseek() method needs to be put in all file systems in order to test for the maximum file size.
I send the mail with the patch to all maintainers of file systems, please comment.
Here is the patch. I put the generic_file_llseek into adfs, affs, bfs, coda, ext2, fat, free_vxfs, hfs, hpfs, jffs, jffs2, minix, ncpfs, nfs,
ntfs, openpromfs, qnx4, ramfs, reiserfs, smbfs, sysv, and udf.
hfs got two additional llseek methods for the metadata, same for openpromfs.
The patch applies to 2.4.5 ac 16.
The cmsfs directory produces an object file with the wrong name, the patch fixes the cmsfs/Makefile do produce the right object file.
Especially the hfs and openpromfs modifications should be checked.
I did not touch the other file systems, there is either no file read or write, or a fix is not straight forward. I did not modifiy the proc file system, the llseek problem should be fixed there in a more general way.
Regards, Martin
Quoted 1 line
Here is the patch.
Sorry, at least most of the patch was there. Here is the rest:
include/linux/fs.h Tue Jun 19 18:28:47 2001 renamed from include/linux/fs.h Tue Jun 19 15:12:50 2001 +1 -0
@@ -1336,6 +1336,7 @@ extern void do_generic_file_read(struct file *, loff_t *, read_descriptor_t *, read_actor_t); extern ssize_t generic_read_dir(struct file *, char *, size_t, loff_t *); +extern loff_t generic_file_llseek(struct file *, loff_t, int); extern int generic_file_open(struct inode *, struct file *); extern struct file_operations generic_ro_fops;
kernel/ksyms.c Wed Jun 20 01:41:21 2001 renamed from kernel/ksyms.c Tue Jun 19 15:13:08 2001 +1 -0
@@ -245,6 +245,7 @@ EXPORT_SYMBOL(vfs_unlink); EXPORT_SYMBOL(vfs_rename); EXPORT_SYMBOL(vfs_statfs); +EXPORT_SYMBOL(generic_file_llseek); EXPORT_SYMBOL(generic_read_dir); EXPORT_SYMBOL(__pollwait); EXPORT_SYMBOL(poll_freewait);