bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

nfsd: patch


From: David Walter
Subject: nfsd: patch
Date: Sun, 24 Nov 2002 02:46:50 -0500
User-agent: Gnus/5.090007 (Oort Gnus v0.07) XEmacs/21.4 (Honest Recruiter, hurd-i386-debian)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

(sorry if this duplicated --- mail problem)

I am not sure about a few things, with this patch, so a few questions,
if someone can point me to a doc that will explain a few things.

But first the story:

I found a few bugs in nfsd after some tail chasing.

nfsd failed to create files from remote non-hurd server and was
expecting anything but a -1 for an input size. 

nfsd also failed to correctly write the data in a copy to a server
directory's file

Both appear to be working with this patch, please test and comment.

file_set_size seems to be failing on the value of (unsigned)-1
(4 gig). This caused the creation to fail. -1 is used to designate set
size unnecessary. (I haven't looked into this further)

I don't know (and don't know what reference to use to find) whether
with large files, this is an incorrect assumption (using the code of
- -1), as that is a valid value with large file support, I believe.

I  suspect that with the other  dependencies on NFS2  in the code that
the fact that  this code depends on the  use of a  -1, isn't an issue,
until NFS3 support is completed in nfsd?

2002-11-24  David Walter  <dwalter@syr.edu>

        * ops.c (op_create): changed size from off_t to loff_t
        cast size as int (not unsigned) in test (size == -1)
        (complete_setattr):  changed size from off_t to loff_t
        (op_read):  changed size from off_t to loff_t
        (op_write):  changed size from off_t to loff_t,
        changed assignment from *reply to bp = (char *) p;
        (where p is in the nfs buffer)



cvs server: Diffing .
Index: ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/nfsd/ChangeLog,v
retrieving revision 1.22
diff --unified -w -i -r1.22 ChangeLog
- --- ChangeLog 29 Sep 2002 15:12:48 -0000      1.22
+++ ChangeLog   24 Nov 2002 07:23:51 -0000
@@ -1,3 +1,14 @@
+2002-11-24  David Walter  <dwalter@syr.edu>
+
+       * ops.c (op_create): changed size from off_t to loff_t
+       cast size as int (not unsigned) in test (size == -1)
+       (complete_setattr):  changed size from off_t to loff_t
+       (op_read):  changed size from off_t to loff_t
+       (op_write):  changed size from off_t to loff_t,
+       changed assignment from *reply to bp = (char *) p;
+       (where p is in the nfs buffer)
+
+
 2002-09-29  Marcus Brinkmann  <marcus@gnu.org>
 
        * loop.c (server_loop): Use memset instead bzero.
Index: Makefile
===================================================================
RCS file: /cvsroot/hurd/hurd/nfsd/Makefile,v
retrieving revision 1.3
diff --unified -w -i -r1.3 Makefile
- --- Makefile  17 Sep 1996 16:43:00 -0000      1.3
+++ Makefile    24 Nov 2002 07:23:51 -0000
@@ -22,6 +22,7 @@
 makemode := utility
 
 SRCS = cache.c loop.c main.c ops.c fsys.c xdr.c
+#SRCS = cache.c loop.c main.c ops.c fsys.c xdr.c decode.c
 OBJS = $(subst .c,.o,$(SRCS))
 LCLHDRS = nfsd.h
 target = nfsd
Index: ops.c
===================================================================
RCS file: /cvsroot/hurd/hurd/nfsd/ops.c,v
retrieving revision 1.8
diff --unified -w -i -r1.8 ops.c
- --- ops.c     29 Sep 2002 15:12:48 -0000      1.8
+++ ops.c       24 Nov 2002 07:23:51 -0000
@@ -60,7 +60,7 @@
                  int *p)
 {
   uid_t uid, gid;
- -  off_t size;
+  loff_t size;
   time_value_t atime, mtime;
   struct stat st;
   error_t err;
@@ -233,7 +233,7 @@
         int **reply,
         int version)
 {
- -  off_t offset;
+  loff_t offset;
   size_t count;
   char buf[2048], *bp = buf;
   mach_msg_type_number_t buflen = sizeof (buf);
@@ -272,7 +272,7 @@
          int **reply,
          int version)
 {
- -  off_t offset;
+  loff_t offset;
   size_t count;
   error_t err;
   mach_msg_type_number_t amt;
@@ -285,7 +285,7 @@
   p++;
   count = ntohl (*p);
   p++;
- -  bp = (char *) *reply;
+  bp = (char *) p;
 
   while (count)
     {
@@ -323,7 +323,7 @@
   struct stat st;
   mode_t mode;
   int statchanged = 0;
- -  off_t size;
+  loff_t size;
 
   p = decode_name (p, &name);
   mode = ntohl (*p);
@@ -351,7 +351,7 @@
 
   size = ntohl (*p);
   p++;
- -  if (size != -1 && size != st.st_size)
+  if ((int) size != -1 && size != st.st_size)
     {
       err = file_set_size (newport, size);
       statchanged = 1;

- -- 
pub  1024D/DC92AE30 2002-02-26 David Walter <dwalter@syr.edu>
fingerprint = 50A0 E513 732D 1D0F BD26  C84E A8DD 9D80 DC92 AE30
sub  2048g/51023582 2002-02-26
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Hurd)
Comment: Processed by Mailcrypt 3.5.6 and Gnu Privacy Guard 
<http://www.gnupg.org/>

iD8DBQE94IPpqN2dgNySrjARAiwfAKCqVZAanLatuRGZAPK3CKcu6c6nGwCfeJMx
ZQS9+flIvfDERengka5baKE=
=RiI/
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]