home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / bsd / 4616 < prev    next >
Encoding:
Text File  |  1992-08-23  |  1.7 KB  |  40 lines

  1. Newsgroups: comp.unix.bsd
  2. Path: sparky!uunet!munnari.oz.au!labtam!labtam!iand
  3. From: iand@labtam.labtam.oz.au (Ian Donaldson)
  4. Subject: Re: lockd on 386BSD
  5. Organization: Labtam Australia Pty. Ltd., Melbourne, Australia
  6. Date: Mon, 24 Aug 1992 04:34:43 GMT
  7. Message-ID: <iand.714630883@labtam>
  8. References: <BtFxC8.3r0@chinet.chi.il.us> <1992Aug23.205117.5204@fcom.cc.utah.edu> <1992Aug24.033540.11335@ugle.unit.no>
  9. Lines: 29
  10.  
  11. arnej@Lise.Unit.NO (Arne Henrik Juul) writes:
  12. >Anyway, I will assert that it IS an NFS problem. The following
  13. >program:
  14.  
  15. >  fd=open("afile", O_CREAT|O_WRONLY|O_APPEND);
  16.  
  17. >Will truncate the file "afile" when you mount FROM an NFS server on a
  18. >386bsd system ON some operating systems (at least SunOS seems to have
  19. >this problem, and probably lots more).
  20.  
  21. >This is a bug *somewhere* in NFS, and the big question is: SunOS or
  22. >386bsd?  Personally I'd bet that SunOS was the problem here, but
  23. >that's only my gut feeling that Sun are unable to implement their own
  24. >protocols according to spec.
  25.  
  26. I fixed this exact bug in an ancient NFS port a few days ago (on a SVR3.2
  27. machine actually).  The problem was that the NFS server wasn't interpreting 
  28. the sattr information provided in the "NFS create" call properly.
  29.  
  30. One field of sattr is the file size.  When you do creat() of the above
  31. form, SunOS sends the file size attribute as -1 over the wire which should 
  32. mean to the server "don't change the file size".  The server is probably 
  33. ignoring this field and truncating the file unconditionally (at least thats what
  34. the server I worked on did).
  35.  
  36. The fix was trivial... just recognize the size attribute and if -1, leave
  37. the file size alone, otherwise truncate to the specified value.
  38.  
  39. Ian D
  40.