public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Frank van Maarseveen <frankvm@xs4all.nl>
To: Andrew Schretter <schrett@math.duke.edu>
Cc: NFS@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: vfs bug. was: Re: [NFS] 2.6.8.1 kernel NFS client connectathon failure
Date: Thu, 16 Sep 2004 00:23:58 +0200	[thread overview]
Message-ID: <20040915222358.GA23118@janus> (raw)
In-Reply-To: <200409152054.i8FKsTNV002355@roma.math.duke.edu>

[-- Attachment #1: Type: text/plain, Size: 928 bytes --]

On Wed, Sep 15, 2004 at 04:54:29PM -0400, Andrew Schretter wrote:
> 
> On local disk runs, TEMP/BAR still exists (I don't know why though).  On NFS
> runs, it does not exists.  This breaks connectathon's test.

Client: 2.6.8.1, server: 2.4.27 (serving ext3)
/proc/mounts: rw,nosuid,nodev,v3,rsize=8192,wsize=8192,hard,udp,lock

Behavior I see is identical to that on a local (ext3) fs on 2.6.8.1 and
also on local ext3 on 2.4.27, namely that TEMP/BAR still exists. This
looks like a long standing kernel bug since the rename(2) seems to
succeed:

(snippet from strace):
write(3, "...", 3)                      = 3
close(3)                                = 0
link("FOO", "TEMP/BAR")                 = 0
rename("TEMP/BAR", "FOO")               = 0
unlink("FOO")                           = 0

output:
ls: FOO: No such file or directory
-rw-r--r--    1 fvm      sec             3 Sep 16 00:21 TEMP/BAR


(CC'ed to lkml)

-- 
Frank

[-- Attachment #2: lnk.c --]
[-- Type: text/plain, Size: 1052 bytes --]

#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/stat.h>

#ifndef MAXPATHLEN
#define MAXPATHLEN	128
#endif

/* maximum number of chars for the message string */
#define STRCHARS	100

main(int ac, char *av[]) {
	int count, fd, slen, lerr, slerr;
	char *fn;
	struct stat sb;
        char str[255];

        if (mkdir("TEMP", 0755)) {
        	perror("mkdir TEMP");
        	exit(0);
        }
	fd = open("FOO", O_RDWR|O_CREAT, 0666);
	if (fd < 0) {
		perror("creat");
		exit(0);
	}
        sprintf(str, "...");
        slen = strlen(str);
	if (write(fd, str, slen) != slen) {
		perror("write");
		(void) close(fd);
		exit(0);
	}
	if (close(fd)) {
		perror("close");
		exit(0);
	}
	if (lerr = link("FOO", "TEMP/BAR")) {
		if (errno != EOPNOTSUPP) {
			perror("link");
			exit(0);
		}
	} else if (rename("TEMP/BAR", "FOO")) {
		perror("rerename");
		exit(0);
	}
	if (unlink("FOO")) {
		perror("unlink 1");
		exit(0);
	}
        system("ls -l FOO TEMP/BAR");
	exit(errno);
}

       reply	other threads:[~2004-09-15 22:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200409152054.i8FKsTNV002355@roma.math.duke.edu>
2004-09-15 22:23 ` Frank van Maarseveen [this message]
2004-09-15 23:02   ` vfs bug. was: Re: [NFS] 2.6.8.1 kernel NFS client connectathon failure viro

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=20040915222358.GA23118@janus \
    --to=frankvm@xs4all.nl \
    --cc=NFS@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schrett@math.duke.edu \
    /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