1. 04 4月, 2009 22 次提交
  2. 31 3月, 2009 1 次提交
  3. 30 3月, 2009 1 次提交
  4. 19 3月, 2009 16 次提交
    • S
      Inconsistent setattr behaviour · 0953e620
      Sachin S. Prabhu 提交于
      There is an inconsistency seen in the behaviour of nfs compared to other local
      filesystems on linux when changing owner or group of a directory. If the
      directory has SUID/SGID flags set, on changing owner or group on the directory,
      the flags are stripped off on nfs. These flags are maintained on other
      filesystems such as ext3.
      
      To reproduce on a nfs share or local filesystem, run the following commands
      mkdir test; chmod +s+g test; chown user1 test; ls -ld test
      
      On the nfs share, the flags are stripped and the output seen is
      drwxr-xr-x 2 user1 root 4096 Feb 23  2009 test
      
      On other local filesystems(ex: ext3), the flags are not stripped and the output
      seen is
      drwsr-sr-x 2 user1 root 4096 Feb 23 13:57 test
      
      chown_common() called from sys_chown() will only strip the flags if the inode is
      not a directory.
      static int chown_common(struct dentry * dentry, uid_t user, gid_t group)
      {
      ..
              if (!S_ISDIR(inode->i_mode))
                      newattrs.ia_valid |=
                              ATTR_KILL_SUID | ATTR_KILL_SGID | ATTR_KILL_PRIV;
      ..
      }
      
      See: http://www.opengroup.org/onlinepubs/7990989775/xsh/chown.html
      
      "If the path argument refers to a regular file, the set-user-ID (S_ISUID) and
      set-group-ID (S_ISGID) bits of the file mode are cleared upon successful return
      from chown(), unless the call is made by a process with appropriate privileges,
      in which case it is implementation-dependent whether these bits are altered. If
      chown() is successfully invoked on a file that is not a regular file, these
      bits may be cleared. These bits are defined in <sys/stat.h>."
      
      The behaviour as it stands does not appear to violate POSIX.  However the
      actions performed are inconsistent when comparing ext3 and nfs.
      Signed-off-by: NSachin Prabhu <sprabhu@redhat.com>
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      0953e620
    • J
      nfsd4: don't check ip address in setclientid · 026722c2
      J. Bruce Fields 提交于
      The spec allows clients to change ip address, so we shouldn't be
      requiring that setclientid always come from the same address.  For
      example, a client could reboot and get a new dhcpd address, but still
      present the same clientid to the server.  In that case the server should
      revoke the client's previous state and allow it to continue, instead of
      (as it currently does) returning a CLID_INUSE error.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      026722c2
    • G
      knfsd: add file to export stats about nfsd pools · 03cf6c9f
      Greg Banks 提交于
      Add /proc/fs/nfsd/pool_stats to export to userspace various
      statistics about the operation of rpc server thread pools.
      
      This patch is based on a forward-ported version of
      knfsd-add-pool-thread-stats which has been shipping in the SGI
      "Enhanced NFS" product since 2006 and which was previously
      posted:
      
      http://article.gmane.org/gmane.linux.nfs/10375
      
      It has also been updated thus:
      
       * moved EXPORT_SYMBOL() to near the function it exports
       * made the new struct struct seq_operations const
       * used SEQ_START_TOKEN instead of ((void *)1)
       * merged fix from SGI PV 990526 "sunrpc: use dprintk instead of
         printk in svc_pool_stats_*()" by Harshula Jayasuriya.
       * merged fix from SGI PV 964001 "Crash reading pool_stats before
         nfsds are started".
      Signed-off-by: NGreg Banks <gnb@sgi.com>
      Signed-off-by: NHarshula Jayasuriya <harshula@sgi.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      03cf6c9f
    • G
      knfsd: remove the nfsd thread busy histogram · 8bbfa9f3
      Greg Banks 提交于
      Stop gathering the data that feeds the 'th' line in /proc/net/rpc/nfsd
      because the questionable data provided is not worth the scalability
      impact of calculating it.  Instead, always report zeroes.  The current
      approach suffers from three major issues:
      
      1. update_thread_usage() increments buckets by call service
         time or call arrival time...in jiffies.  On lightly loaded
         machines, call service times are usually < 1 jiffy; on
         heavily loaded machines call arrival times will be << 1 jiffy.
         So a large portion of the updates to the buckets are rounded
         down to zero, and the histogram is undercounting.
      
      2. As seen previously on the nfs mailing list, the format in which
         the histogram is presented is cryptic, difficult to explain,
         and difficult to use.
      
      3. Updating the histogram requires taking a global spinlock and
         dirtying the global variables nfsd_last_call, nfsd_busy, and
         nfsdstats *twice* on every RPC call, which is a significant
         scaling limitation.
      
      Testing on a 4 CPU 4 NIC Altix using 4 IRIX clients each doing
      1K streaming reads at full line rate, shows the stats update code
      (inlined into nfsd()) takes about 1.7% of each CPU.  This patch drops
      the contribution from nfsd() into the profile noise.
      
      This patch is a forward-ported version of knfsd-remove-nfsd-threadstats
      which has been shipping in the SGI "Enhanced NFS" product since 2006.
      In that time, exactly one customer has noticed that the threadstats
      were missing.  It has been previously posted:
      
      http://article.gmane.org/gmane.linux.nfs/10376
      
      and more recently requested to be posted again.
      Signed-off-by: NGreg Banks <gnb@sgi.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      8bbfa9f3
    • J
      nfsd4: remove redundant check from nfsd4_open · 5cb031b0
      J. Bruce Fields 提交于
      Note that we already checked for this invalid case at the top of this
      function.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      5cb031b0
    • J
      nfsd4: don't do lookup within readdir in recovery code · 05f4f678
      J. Bruce Fields 提交于
      The main nfsd code was recently modified to no longer do lookups from
      withing the readdir callback, to avoid locking problems on certain
      filesystems.
      
      This (rather hacky, and overdue for replacement) NFSv4 recovery code has
      the same problem.  Fix it to build up a list of names (instead of
      dentries) and do the lookups afterwards.
      
      Reported symptoms were a deadlock in the xfs code (called from
      nfsd4_recdir_load), with /var/lib/nfs on xfs.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Reported-by: NDavid Warren <warren@atmos.washington.edu>
      05f4f678
    • J
      nfsd4: support putpubfh operation · a1c8c4d1
      J. Bruce Fields 提交于
      Currently putpubfh returns NFSERR_OPNOTSUPP, which isn't actually
      allowed for v4.  The right error is probably NFSERR_NOTSUPP.
      
      But let's just implement it; though rarely seen, it can be used by
      Solaris (with a special mount option), is mandated by the rfc, and is
      trivial for us to support.
      
      Thanks to Yang Hongyang for pointing out the original problem, and to
      Mike Eisler, Tom Talpey, Trond Myklebust, and Dave Noveck for further
      argument....
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      a1c8c4d1
    • D
      Short write in nfsd becomes a full write to the client · 31dec253
      David Shaw 提交于
      If a filesystem being written to via NFS returns a short write count
      (as opposed to an error) to nfsd, nfsd treats that as a success for
      the entire write, rather than the short count that actually succeeded.
      
      For example, given a 8192 byte write, if the underlying filesystem
      only writes 4096 bytes, nfsd will ack back to the nfs client that all
      8192 bytes were written.  The nfs client does have retry logic for
      short writes, but this is never called as the client is told the
      complete write succeeded.
      
      There are probably other ways it could happen, but in my case it
      happened with a fuse (filesystem in userspace) filesystem which can
      rather easily have a partial write.
      
      Here is a patch to properly return the short write count to the
      client.
      Signed-off-by: NDavid Shaw <dshaw@jabberwocky.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      31dec253
    • B
      NFSD: return nfsv4 error code nfserr_notsupp rather than nfsv[23]'s nfserr_opnotsupp · 1e685ec2
      Benny Halevy 提交于
      Thanks for Bill Baker at sun.com for catching this
      at Connectathon 2009.
      
      This bug was introduced in 2.6.27
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      1e685ec2
    • J
      a601caed
    • J
      nfsd4: fix do_probe_callback errors · 418cd20a
      J. Bruce Fields 提交于
      The errors returned aren't used.  Just return 0 and make them available
      to a dprintk().  Also, consistently use -ERRNO errors instead of nfs
      errors.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Reviewed-by: NBenny Halevy <bhalevy@panasas.com>
      418cd20a
    • J
      nfsd4: remove use of mutex for file_hashtable · 8b671b80
      J. Bruce Fields 提交于
      As part of reducing the scope of the client_mutex, and in order to
      remove the need for mutexes from the callback code (so that callbacks
      can be done as asynchronous rpc calls), move manipulations of the
      file_hashtable under the recall_lock.
      
      Update the relevant comments while we're here.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Cc: Alexandros Batsakis <batsakis@netapp.com>
      Reviewed-by: NBenny Halevy <bhalevy@panasas.com>
      8b671b80
    • J
      nfsd4: put_nfs4_client does not require state lock · d7fdcfe0
      J. Bruce Fields 提交于
      Since free_client() is guaranteed to only be called once, and to only
      touch the client structure itself (not any common data structures), it
      has no need for the state lock.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Cc: Alexandros Batsakis <batsakis@netapp.com>
      d7fdcfe0
    • J
      nfsd4: rename io_during_grace_disallowed · 18f82731
      J. Bruce Fields 提交于
      Use a slightly clearer, more concise name.  Also removed unused
      argument.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      18f82731
    • J
      nfsd4: remove unused CHECK_FH flag · 6150ef0d
      J. Bruce Fields 提交于
      All users now pass this, so it's meaningless.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      6150ef0d
    • J
      nfsd4: fail when delegreturn gets a non-delegation stateid · 7e0f7cf5
      J. Bruce Fields 提交于
      Previous cleanup reveals an obvious (though harmless) bug: when
      delegreturn gets a stateid that isn't for a delegation, it should return
      an error rather than doing nothing.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      7e0f7cf5