linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Salvador Ortiz Garcia <sog@msg.com.mx>
To: linux-kernel@vger.kernel.org
Cc: alan@lxorguk.ukuu.org.uk
Subject: 2.4.0 - lseek on /proc broken? [with patch]
Date: Tue, 16 Jan 2001 00:53:47 -0600 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.10.10101160024480.20764-100000@xiomara.msg.com.mx> (raw)


Hi:

After diging around for some problems (shutdown/unmount related) I found
that some processes where hidden from ps, pidoff, ls /proc, etc.

A strace reveled that:

open("/proc", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 7
fstat(7, {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
fcntl(7, F_SETFD, FD_CLOEXEC)           = 0
getdents(7, /* 58 entries */, 984)      = 980
lseek(7, 265, SEEK_SET)                 = -1 EINVAL (Invalid argument)

So I change proc_root_operations to use proc_file_lseek and the problems
vanished.

Comments?

Salvador Ortiz.
please CCs to me.

 
=========== cut ===========
diff -u linux/fs/proc/generic.c linux-2.4.0-ac7/fs/proc/generic.c
--- linux/fs/proc/generic.c	Mon Dec 11 15:45:42 2000
+++ linux-2.4.0-msg/fs/proc/generic.c	Tue Jan 16 00:05:24 2001
@@ -22,7 +22,7 @@
 			      size_t nbytes, loff_t *ppos);
 static ssize_t proc_file_write(struct file * file, const char * buffer,
 			       size_t count, loff_t *ppos);
-static loff_t proc_file_lseek(struct file *, loff_t, int);
+loff_t proc_file_lseek(struct file *, loff_t, int);
 
 int proc_match(int len, const char *name,struct proc_dir_entry * de)
 {
@@ -137,7 +137,7 @@
 }
 
 
-static loff_t
+loff_t
 proc_file_lseek(struct file * file, loff_t offset, int orig)
 {
     switch (orig) {
diff -u linux/fs/proc/root.c linux-2.4.0-ac7/fs/proc/root.c
--- linux/fs/proc/root.c	Thu Nov 23 11:07:36 2000
+++ linux-2.4.0-msg/fs/proc/root.c	Tue Jan 16 00:05:27 2001
@@ -81,7 +81,9 @@
  * <pid> directories. Thus we don't use the generic
  * directory handling functions for that..
  */
+extern loff_t proc_file_lseek(struct file *, loff_t, int);
 static struct file_operations proc_root_operations = {
+	llseek:		 proc_file_lseek,
 	read:		 generic_read_dir,
 	readdir:	 proc_root_readdir,
 };

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

                 reply	other threads:[~2001-01-16  6:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=Pine.LNX.4.10.10101160024480.20764-100000@xiomara.msg.com.mx \
    --to=sog@msg.com.mx \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).