mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* large offset llseek breaks for device special files on ac series
@ 2001-06-19 20:31 Martin Frey
  2001-06-19 20:34 ` Alan Cox
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Frey @ 2001-06-19 20:31 UTC (permalink / raw)
  To: alan, linux-kernel; +Cc: baettig

Hi,

the ac 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.
Either we change the check or we have to write a llseek
method for each device driver.

The patch below by-passes the check for non-file inodes.
The patch is against 2.4.5.ac16. The problem was introduced
earlier (at least on 2.4.3.ac14 the same check is there).

--- linux-2.4.5.ac16/fs/read_write.c    Tue Jun 19 15:11:58 2001
+++ linux-2.4.5.ac16.patched/fs/read_write.c    Tue Jun 19 15:28:37 2001
@@ -36,7 +36,7 @@
                        offset += file->f_pos;
        }
        retval = -EINVAL;
-       if (offset>=0 && offset<=file->f_dentry->d_inode->i_sb->s_maxbytes) {
+       if (offset>=0 && (!S_ISREG(file->f_dentry->d_inode->i_mode) || offset<=file->f_dentry->d_inode->i_sb->s_maxbytes)) {
                if (offset != file->f_pos) {
                        file->f_pos = offset;
                        file->f_reada = 0;


Regards, Martin


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-06-19 20:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-19 20:31 large offset llseek breaks for device special files on ac series Martin Frey
2001-06-19 20:34 ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®