From: "Martin Frey" <frey@scs.ch>
To: <alan@lxorguk.ukuu.org.uk>, <linux-kernel@vger.kernel.org>
Cc: <baettig@scs.ch>
Subject: large offset llseek breaks for device special files on ac series
Date: Tue, 19 Jun 2001 16:31:31 -0400 [thread overview]
Message-ID: <014b01c0f8fe$d457a830$0100007f@SCHLEPPDOWN> (raw)
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
next reply other threads:[~2001-06-19 20:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-19 20:31 Martin Frey [this message]
2001-06-19 20:34 ` Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='014b01c0f8fe$d457a830$0100007f@SCHLEPPDOWN' \
--to=frey@scs.ch \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=baettig@scs.ch \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.frey@compaq.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®