From: Alexey Dobriyan <adobriyan@parallels.com>
To: akpm@osdl.org
Cc: viro@ftp.linux.org.uk, linux-kernel@vger.kernel.org,
Joakim Tjernlund <joakim.tjernlund@transmode.se>
Subject: [PATCH] seq_file: make seq_lseek accept SEEK_END
Date: Mon, 9 Jun 2008 15:01:12 +0400 [thread overview]
Message-ID: <200806091501.13170.adobriyan@parallels.com> (raw)
Apologies for delay, such simple thing should have been sent long ago.
Joakim, please, confirm.
-------------------------------------------
[PATCH] seq_file: make seq_lseek accept SEEK_END
and pretend seq_files have zero length. This should be enough
to fix busybox start-stop-daemon:
http://marc.info/?t=120836691600002&r=1&w=2
It does xlseek(fd, 0, SEEK_END) to estimate amount of memory to malloc
but satisfied with 0. Sudden -EINVAL from lseek(2) breaks it.
X-Introduced-By: f16278c679aa72e28288435b313ba2d4494d6be5
Signed-off-by: Alexey Dobriyan <adobriyan@parallels.com>
---
fs/seq_file.c | 2 ++
1 file changed, 2 insertions(+)
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -254,6 +254,8 @@ loff_t seq_lseek(struct file *file, loff_t offset, int origin)
switch (origin) {
case 1:
offset += file->f_pos;
+ case 2:
+ /* pretend it's zero length */
case 0:
if (offset < 0)
break;
next reply other threads:[~2008-06-09 11:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-09 11:01 Alexey Dobriyan [this message]
2008-06-09 11:52 ` [PATCH] seq_file: make seq_lseek accept SEEK_END Joakim Tjernlund
2008-06-11 21:29 ` Andrew Morton
2008-06-15 22:58 ` Alexey Dobriyan
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=200806091501.13170.adobriyan@parallels.com \
--to=adobriyan@parallels.com \
--cc=akpm@osdl.org \
--cc=joakim.tjernlund@transmode.se \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@ftp.linux.org.uk \
/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