lkml.org 
[lkml]   [1999]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectmkfifo in 2.0.36 NFS client
I had a bug report about mkfifo not working on a 2.0.36 nfs client.

Look at this part of patch-2.0.36:

diff -u --recursive --new-file v2.0.35/linux/fs/nfs/dir.c linux/fs/nfs/dir.c
--- v2.0.35/linux/fs/nfs/dir.c Sun Nov 15 10:49:49 1998
+++ linux/fs/nfs/dir.c Sun Nov 15 10:33:14 1998
@@ -8,6 +8,11 @@
* 10 Apr 1996 Added silly rename for unlink --okir
*/

+/*
+ * Fixes:
+ * Ion Badulescu <ionut@cs.columbia.edu> : FIFO's need special handling in NFSv2
+ */
+
#include <linux/sched.h>
#include <linux/errno.h>
#include <linux/stat.h>
@@ -443,7 +448,10 @@
iput(dir);
return -ENAMETOOLONG;
}
- sattr.mode = mode;
+ if (S_ISFIFO(mode))
+ sattr.mode = (mode & ~S_IFMT) | S_IFCHR;
+ else
+ sattr.mode = mode;
sattr.uid = sattr.gid = (unsigned) -1;
if (S_ISCHR(mode) || S_ISBLK(mode))
sattr.size = rdev; /* get out your barf bag */
@@ -452,6 +460,11 @@
sattr.atime.seconds = sattr.mtime.seconds = (unsigned) -1;
error = nfs_proc_create(NFS_SERVER(dir), NFS_FH(dir),
name, &sattr, &fhandle, &fattr);
+ if (error == -EINVAL && (S_ISFIFO(mode))) {
+ sattr.mode = mode;
+ error = nfs_proc_create(NFS_SERVER(dir), NFS_FH(dir),
+ name, &sattr, &fhandle, &fattr);
+ }
if (!error)
{
nfs_lookup_cache_add(dir, name, &fhandle, &fattr);
What I understand is that if the mode of the mknod is S_IFIFO, the mode
passed to the server will be S_IFCHR and it the server will fail to create
the chr dev (not the fifo), _then_ we'll revert to really request the
server to create a fifo.

And infact the problem reported by my friend Leonardo (another of the
admin of our University) is exectly that if he runs mkfifo on the 2.0.36
NFS client, a chrdev is generated on the server (while both 2.0.35 and
2.2.3 are creating a fifo).

Could somebody explain the reason of the patch?

Thanks.

Andrea Arcangeli


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

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.064 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site