All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Matthias Andree <ma@dt.e-technik.uni-dortmund.de>
Cc: Linux-Kernel mailing list <linux-kernel@vger.kernel.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: 2.2.19 NFSv3 client breaks fdopen(3)
Date: Thu, 26 Apr 2001 19:43:19 +0200	[thread overview]
Message-ID: <15080.24119.524229.296133@charged.uio.no> (raw)
In-Reply-To: <20010426192632.A18492@maggie.dt.e-technik.uni-dortmund.de>
In-Reply-To: <20010426192632.A18492@maggie.dt.e-technik.uni-dortmund.de>

>>>>> " " == Matthias Andree <ma@dt.e-technik.uni-dortmund.de> writes:

     > Hi, SHORT:

     > the current 2.2.19 fs/nfs/dir.c ll. 455ff. nfs_dir_lseek breaks
     > fdopen(3) which (at least with glibc 2.1.3) cals __llseek with
     > offset==0 and whence==1 (SEEK_CUR), probably to poll the
     > current file position.  Application software affected comprises
     > cvs (tried 1.10.7) and Perl5 (sysopen, see below).

     > I suggest that SEEK_CUR be allowed for offset == 0 in
     > nfs_dir_llseek, but I'm asking for help since I'm not into this
     > and cannot do this on my own. Thanks in advance.

Ion has already sent in a patch to Alan for this. Here it is...

Please note that if glibc is checking this return value, it will still
screw up if file->f_pos > 0x7fffffff, which can and does happen
against certain servers (particularly IRIX).

As I've said before: it is a bug for glibc to be relying on seekdir if
we want to support non-POSIX compliant filesystems under Linux.

Cheers,
   Trond

--- /mnt/3/linux-2.2.19/fs/nfs/dir.c	Sun Mar 25 08:37:38 2001
+++ linux-2.2.19/fs/nfs/dir.c	Thu Apr  5 14:37:59 2001
@@ -454,6 +454,9 @@
  */
 static loff_t nfs_dir_llseek(struct file *file, loff_t offset, int origin)
 {
+	/* Glibc 2.0 backwards compatibility crap... */
+	if (origin == 1 && offset == 0)
+		return file->f_pos;
 	/* We disallow SEEK_CUR and SEEK_END */
 	if (origin != 0)
 		return -EINVAL;


  reply	other threads:[~2001-04-26 17:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-26 17:26 2.2.19 NFSv3 client breaks fdopen(3) Matthias Andree
2001-04-26 17:43 ` Trond Myklebust [this message]
2001-04-26 23:30   ` Matthias Andree
2001-04-27 11:11     ` Trond Myklebust
2001-04-27 11:02   ` Matthias Andree

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=15080.24119.524229.296133@charged.uio.no \
    --to=trond.myklebust@fys.uio.no \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ma@dt.e-technik.uni-dortmund.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.