1. 15 10月, 2008 3 次提交
  2. 11 10月, 2008 18 次提交
  3. 10 10月, 2008 1 次提交
    • T
      NFS: Fix attribute updates · 03254e65
      Trond Myklebust 提交于
      This fixes a regression seen when running the Connectathon testsuite
      against an ext3 filesystem. The reason was that the inode was constantly
      being marked as 'just updated' by the jiffy wraparound test.
      This again meant that newer GETATTR calls were failing to pass the
      nfs_inode_attrs_need_update() test unless the changes caused a ctime update
      on the server, since they were perceived as having been started before the
      latest inode update.
      
      Given that nfs_inode_attrs_need_update() already checks for wraparound
      of nfsi->last_updated, we can drop the buggy "protection" in
      nfs_update_inode().
      
      Also make a slight micro-optimisation of nfs_inode_attrs_need_update(): we
      are more often going to see time_after(fattr->time_start, nfsi->last_updated)
      be true, rather than seeing an update of ctime/size, so put that test
      first to ensure that we optimise away the ctime/size tests.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      03254e65
  4. 09 10月, 2008 1 次提交
  5. 08 10月, 2008 17 次提交
    • C
      sunrpc: fix oops in rpc_create when the mount namespace is unshared · 63ffc23d
      Cedric Le Goater 提交于
      On a system with nfs mounts, if a task unshares its mount namespace,
      a oops can occur when the system is rebooted if the task is the last
      to unreference the nfs mount. It will try to create a rpc request
      using utsname() which has been invalidated by free_nsproxy().
      
      The patch fixes the issue by using the global init_utsname() which is
      always valid. the capability of identifying rpc clients per uts namespace
      stills needs some extra work so this should not be a problem.
      
      BUG: unable to handle kernel NULL pointer dereference at 00000004
      IP: [<c024c9ab>] rpc_create+0x332/0x42f
      Oops: 0000 [#1] DEBUG_PAGEALLOC
      
      Pid: 1857, comm: uts-oops Not tainted (2.6.27-rc5-00319-g7686ad56 #4)
      EIP: 0060:[<c024c9ab>] EFLAGS: 00210287 CPU: 0
      EIP is at rpc_create+0x332/0x42f
      EAX: 00000000 EBX: df26adf0 ECX: c0251887 EDX: 00000001
      ESI: df26ae58 EDI: c02f293c EBP: dda0fc9c ESP: dda0fc2c
       DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068
      Process uts-oops (pid: 1857, ti=dda0e000 task=dd9a0778 task.ti=dda0e000)
      Stack: c0104532 dda0fffc dda0fcac dda0e000 dda0e000 dd93b7f0 00000009 c02f2880
             df26aefc dda0fc68 c01096b7 00000000 c0266ee0 c039a070 c039a070 dda0fc74
             c012ca67 c039a064 dda0fc8c c012cb20 c03daf74 00000011 00000000 c0275c90
      Call Trace:
       [<c0104532>] ? dump_trace+0xc2/0xe2
       [<c01096b7>] ? save_stack_trace+0x1c/0x3a
       [<c012ca67>] ? save_trace+0x37/0x8c
       [<c012cb20>] ? add_lock_to_list+0x64/0x96
       [<c0256fc4>] ? rpcb_register_call+0x62/0xbb
       [<c02570c8>] ? rpcb_register+0xab/0xb3
       [<c0252f4d>] ? svc_register+0xb4/0x128
       [<c0253114>] ? svc_destroy+0xec/0x103
       [<c02531b2>] ? svc_exit_thread+0x87/0x8d
       [<c01a75cd>] ? lockd_down+0x61/0x81
       [<c01a577b>] ? nlmclnt_done+0xd/0xf
       [<c01941fe>] ? nfs_destroy_server+0x14/0x16
       [<c0194328>] ? nfs_free_server+0x4c/0xaa
       [<c019a066>] ? nfs_kill_super+0x23/0x27
       [<c0158585>] ? deactivate_super+0x3f/0x51
       [<c01695d1>] ? mntput_no_expire+0x95/0xb4
       [<c016965b>] ? release_mounts+0x6b/0x7a
       [<c01696cc>] ? __put_mnt_ns+0x62/0x70
       [<c0127501>] ? free_nsproxy+0x25/0x80
       [<c012759a>] ? switch_task_namespaces+0x3e/0x43
       [<c01275a9>] ? exit_task_namespaces+0xa/0xc
       [<c0117fed>] ? do_exit+0x4fd/0x666
       [<c01181b3>] ? do_group_exit+0x5d/0x83
       [<c011fa8c>] ? get_signal_to_deliver+0x2c8/0x2e0
       [<c0102630>] ? do_notify_resume+0x69/0x700
       [<c011d85a>] ? do_sigaction+0x134/0x145
       [<c0127205>] ? hrtimer_nanosleep+0x8f/0xce
       [<c0126d1a>] ? hrtimer_wakeup+0x0/0x1c
       [<c0103488>] ? work_notifysig+0x13/0x1b
       =======================
      Code: 70 20 68 cb c1 2c c0 e8 75 4e 01 00 8b 83 ac 00 00 00 59 3d 00 f0 ff ff 5f 77 63 eb 57 a1 00 80 2d c0 8b 80 a8 02 00 00 8d 73 68 <8b> 40 04 83 c0 45 e8 41 46 f7 ff ba 20 00 00 00 83 f8 21 0f 4c
      EIP: [<c024c9ab>] rpc_create+0x332/0x42f SS:ESP 0068:dda0fc2c
      Signed-off-by: NCedric Le Goater <clg@fr.ibm.com>
      Cc: Chuck Lever <chuck.lever@oracle.com>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: "Serge E. Hallyn" <serue@us.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      63ffc23d
    • T
      NFS: Don't use range_cyclic for data integrity syncs · d7fb1207
      Trond Myklebust 提交于
      It is more efficient to write linearly starting from the beginning of the
      file.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      d7fb1207
    • S
      NFS: Client mounts hang when exported directory do not exist · 8491945f
      Steve Dickson 提交于
      This patch fixes a regression that was introduced by the string based mounts.
      
      nfs_mount() statically returns -EACCES for every error returned
      by the remote mounted. This is incorrect because -EACCES is
      an non-fatal error to the mount.nfs command. This error causes
      mount.nfs to retry the mount even in the case when the exported
      directory does not exist.
      
      This patch maps the errors returned by the remote mountd into
      valid errno values, exactly how it was done pre-string based
      mounts. By returning the correct errno enables mount.nfs
      to do the right thing.
      Signed-off-by: NSteve Dickson <steved@redhat.com>
      [Trond.Myklebust@netapp.com: nfs_stat_to_errno() now correctly returns
       negative errors, so remove the sign change.]
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      8491945f
    • T
      96165e2b
    • T
      SUNRPC: Fix autobind on cloned rpc clients · 9a4bd29f
      Trond Myklebust 提交于
      Despite the fact that cloned rpc clients won't have the cl_autobind flag
      set, they may still find themselves calling rpcb_getport_async(). For this
      to happen, it suffices for a _parent_ rpc_clnt to use autobinding, in which
      case any clone may find itself triggering the !xprt_bound() case in
      call_bind().
      
      The correct fix for this is to walk back up the tree of cloned rpc clients,
      in order to find the parent that 'owns' the transport, either because it
      has clnt->cl_autobind set, or because it originally created the
      transport...
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      9a4bd29f
    • C
      NFS: SETCLIENTID truncates client ID and netid · d1ce02e1
      Chuck Lever 提交于
      The sc_name field is currently 56 bytes long.  This is not large enough
      to hold a pair of IPv6 addresses, the authentication type, the protocol
      name, and a uniquifier number.  The maximum possible size of the name
      string using IPv6 addresses is just under 110 bytes, so I increased the
      size of the sc_name field to accomodate this maximum.
      
      In addition, the strings in the nfs4_setclientid structure are
      constructed with scnprintf(), which wants to terminate its output with
      '\0'.  The sc_netid field was large enough only for a three byte netid
      string and a '\0' so inet6 netids were being truncated.  Perhaps we
      don't need the overhead of scnprintf() to do a simple string copy, but
      I fixed this by increasing the size of the buffer by one byte.
      
      Since all three of the string buffers in nfs4_setclientid are
      constructed with scnprintf(), I increased the size of all three by one
      byte to document the requirement, although I don't think either the
      universal address field or the name field will be so small that these
      strings get truncated in this way.
      
      The size of the Linux client's client ID on the wire will be larger
      than before.  RFC 3530 suggests the size limit for client IDs is 1024,
      and we are still well below that.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      d1ce02e1
    • R
      NFS: remove 8 bytes of padding from struct nfs_fattr on 64 bit builds · 9fa8d66f
      Richard Kennedy 提交于
      remove 8 bytes of padding from struct nfs_fattr on 64 bit builds
      
      This also removes padding from several nfs structures, including
      16 bytes from  nfs4_opendata, nfs4_createdata,nfs3_createdata
      & 8 bytes from nfs_read_data,nfs_write_data,nfs_removeres,nfs4_closedata
      
      This also reduces the reported stack usage of many nfs functions (30+).
      Signed-off-by: NRichard Kennedy <richard@rsk.demon.co.uk>
      ----
      
      This patch is against the latest git 2.6.27-rc4.
      I've built & run this on my AMD64 desktop, & successfully run _simple_
      tests with a  64 bit client => 32 bit server & 32 bit client to 64 bit
      server.
      
      On fedora with gcc (GCC) 4.3.0 20080428 (Red Hat 4.3.0-8) checkpatch
      reports 33 functions with reduced stack usage.
      e.g.
      __nfs_revalidate_inode [nfs] 216 => 200
      _nfs4_proc_access [nfs] 304 => 288
      _nfs4_proc_link [nfs] 536 => 504
      _nfs4_proc_remove [nfs] 304 => 288
      _nfs4_proc_rename [nfs] 584 => 552
      nfs3_proc_access [nfs] 272 => 256
      nfs3_proc_getacl [nfs] 384 => 368
      nfs3_proc_link [nfs] 496 => 464
      etc
      I can supply the complete list if anyone is interested.
      
      regards
      Richard
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      9fa8d66f
    • J
      nfs: Fix misparsing of nfsv4 fs_locations attribute · ea31a443
      J. Bruce Fields 提交于
      The code incorrectly assumes here that the server name (or ip address)
      is null-terminated.  This can cause referrals to fail in some cases.
      
      Also support ipv6 addresses.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      ea31a443
    • J
      nfs: prepare to share nfs_set_port · f0c92925
      J. Bruce Fields 提交于
      We plan to use this function elsewhere.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      f0c92925
    • J
      nfs: replace while loop by for loops in nfs_follow_referral · 460cdbc8
      J. Bruce Fields 提交于
      Whoever wrote this had a bizarre allergy to for loops.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      460cdbc8
    • J
      nfs: break up nfs_follow_referral · 4ada29d5
      J. Bruce Fields 提交于
      This function is a little longer and more deeply nested than necessary.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      4ada29d5
    • E
      nfs: authenticated deep mounting · 37ca8f5c
      EG Keizer 提交于
      Allow mount to do authenticated mounts below the root of the exported tree.
      The wording in RFC 2623, sec 2.3.2. allows fsinfo with UNIX authentication
      on the root of the export. Mounts are not always done on the root
      of the exported tree. Especially autoumounts often mount below the root of
      the exported tree.
      Some server implementations (justly) require full authentication for the
      so-called deep mounts. The old code used AUTH_SYS only. This caused deep
      mounts to fail on systems requiring stronger authentication..
      The client should try both authentication types and use the first one that
      succeeds.
      This method was already partially implemented. This patch completes
      the implementation for NFS2 and NFS3.
      This patch was developed to allow Debian systems to automount home directories
      on Solaris servers with krb5 authentication.
      
      Tested on kernel 2.6.24-etchnhalf.1
      Signed-off-by: NE.G. Keizer <keie@few.vu.nl>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      37ca8f5c
    • J
      NFS: missing nfs_fattr_init in nfs3_proc_getacl and nfs3_proc_setacls (resend #2) · f25b874d
      Jeff Layton 提交于
      The fattrs used in the NFSv3 getacl/setacl calls are not being properly
      initialized. This occasionally causes nfs_update_inode to fall into
      NFSv4 specific codepaths when handling post-op attrs from these calls.
      
      Thanks to Cai Qian for noticing the spurious NFSv4 messages in debug
      output from a v3 mount...
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      f25b874d
    • J
      nfs: remove an obsolete nfs_flock comment · f200c11c
      J. Bruce Fields 提交于
      We *do* now allow bsd flocks over nfs.
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      f200c11c
    • D
      nfs: BUG_ON in nfs_follow_mountpoint · 44d5759d
      Denis V. Lunev 提交于
      Unfortunately, BUG_ON(IS_ROOT(dentry)) can happen inside
      nfs_follow_mountpoint with NFS running Fedora 8 using a
      specific setup.
      https://bugzilla.redhat.com/show_bug.cgi?id=458622
      
      So, the situation should be handled on NFS client gracefully.
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      CC: Trond Myklebust <Trond.Myklebust@netapp.com>
      CC: J. Bruce Fields <bfields@fieldses.org>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      44d5759d
    • D
      sunrpc: do not pin sunrpc module in the memory · c9f6cde6
      Denis V. Lunev 提交于
      Basically, try_module_get here are pretty useless. Any other module using
      this API will pin sunrpc in memory due using exported symbols.
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      c9f6cde6
    • D
      nfs: ERR_PTR is expected on failure from nfs_do_clone_mount · fd08d7e9
      Denis V. Lunev 提交于
      Replace NULL with ERR_PTR(-EINVAL).
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      fd08d7e9