1. 25 9月, 2012 2 次提交
  2. 12 9月, 2012 1 次提交
  3. 07 9月, 2012 1 次提交
  4. 06 9月, 2012 1 次提交
  5. 05 9月, 2012 3 次提交
  6. 21 8月, 2012 2 次提交
  7. 17 8月, 2012 7 次提交
  8. 09 8月, 2012 1 次提交
  9. 03 8月, 2012 5 次提交
  10. 01 8月, 2012 6 次提交
    • M
      nfs: prevent page allocator recursions with swap over NFS. · 192e501b
      Mel Gorman 提交于
      GFP_NOFS is _more_ permissive than GFP_NOIO in that it will initiate IO,
      just not of any filesystem data.
      
      The problem is that previously NOFS was correct because that avoids
      recursion into the NFS code.  With swap-over-NFS, it is no longer correct
      as swap IO can lead to this recursion.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NMel Gorman <mgorman@suse.de>
      Acked-by: NRik van Riel <riel@redhat.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Eric B Munson <emunson@mgebm.net>
      Cc: Eric Paris <eparis@redhat.com>
      Cc: James Morris <jmorris@namei.org>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      Cc: Xiaotian Feng <dfeng@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      192e501b
    • M
      nfs: enable swap on NFS · a564b8f0
      Mel Gorman 提交于
      Implement the new swapfile a_ops for NFS and hook up ->direct_IO.  This
      will set the NFS socket to SOCK_MEMALLOC and run socket reconnect under
      PF_MEMALLOC as well as reset SOCK_MEMALLOC before engaging the protocol
      ->connect() method.
      
      PF_MEMALLOC should allow the allocation of struct socket and related
      objects and the early (re)setting of SOCK_MEMALLOC should allow us to
      receive the packets required for the TCP connection buildup.
      
      [jlayton@redhat.com: Restore PF_MEMALLOC task flags in all cases]
      [dfeng@redhat.com: Fix handling of multiple swap files]
      [a.p.zijlstra@chello.nl: Original patch]
      Signed-off-by: NMel Gorman <mgorman@suse.de>
      Acked-by: NRik van Riel <riel@redhat.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Eric B Munson <emunson@mgebm.net>
      Cc: Eric Paris <eparis@redhat.com>
      Cc: James Morris <jmorris@namei.org>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      Cc: Xiaotian Feng <dfeng@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a564b8f0
    • M
      nfs: disable data cache revalidation for swapfiles · 29418aa4
      Mel Gorman 提交于
      The VM does not like PG_private set on PG_swapcache pages.  As suggested
      by Trond in http://lkml.org/lkml/2006/8/25/348, this patch disables NFS
      data cache revalidation on swap files.  as it does not make sense to have
      other clients change the file while it is being used as swap.  This avoids
      setting PG_private on swap pages, since there ought to be no further races
      with invalidate_inode_pages2() to deal with.
      
      Since we cannot set PG_private we cannot use page->private which is
      already used by PG_swapcache pages to store the nfs_page.  Thus augment
      the new nfs_page_find_request logic.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NMel Gorman <mgorman@suse.de>
      Acked-by: NRik van Riel <riel@redhat.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Eric B Munson <emunson@mgebm.net>
      Cc: Eric Paris <eparis@redhat.com>
      Cc: James Morris <jmorris@namei.org>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      Cc: Xiaotian Feng <dfeng@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      29418aa4
    • M
      nfs: teach the NFS client how to treat PG_swapcache pages · d56b4ddf
      Mel Gorman 提交于
      Replace all relevant occurences of page->index and page->mapping in the
      NFS client with the new page_file_index() and page_file_mapping()
      functions.
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NMel Gorman <mgorman@suse.de>
      Acked-by: NRik van Riel <riel@redhat.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Eric B Munson <emunson@mgebm.net>
      Cc: Eric Paris <eparis@redhat.com>
      Cc: James Morris <jmorris@namei.org>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Mike Christie <michaelc@cs.wisc.edu>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      Cc: Xiaotian Feng <dfeng@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d56b4ddf
    • J
      nfs: explicitly reject LOCK_MAND flock() requests · ad0fcd4e
      Jeff Layton 提交于
      We have no mechanism to emulate LOCK_MAND locks on NFSv4, so explicitly
      return -EINVAL if someone requests it.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      ad0fcd4e
    • N
      nfs: increase number of permitted callback connections. · b042414f
      NeilBrown 提交于
      By default a sunrpc service is limited to (N+3)*20 connections
      where N is the number of threads.  This is 80 when N==1.
      If this number is exceeded a warning is printed suggesting that
      the number of threads be increased.  However with services which
      run a single thread, this is impossible.
      
      For such services there is a ->sv_maxconn setting that can be
      used to forcibly increase the limit, and silence the message.
      This is used by lockd.
      
      The nfs client uses a sunrpc service to handle callbacks and
      it too is single-threaded, so to avoid the useless messages,
      and to allow a reasonable number of concurrent connections,
      we need to set ->sv_maxconn.  1024 seems like a good number.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      b042414f
  11. 31 7月, 2012 11 次提交
    • B
      NFS: Convert v4 into a module · 89d77c8f
      Bryan Schumaker 提交于
      This patch exports symbols needed by the v4 module.  In addition, I also
      switch over to using IS_ENABLED() to check if CONFIG_NFS_V4 or
      CONFIG_NFS_V4_MODULE are set.
      
      The module (nfs4.ko) will be created in the same directory as nfs.ko and
      will be automatically loaded the first time you try to mount over NFS v4.
      Signed-off-by: NBryan Schumaker <bjschuma@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      89d77c8f
    • B
      NFS: Convert v3 into a module · 1c606fb7
      Bryan Schumaker 提交于
      This patch exports symbols and moves over the final structures needed by
      the v3 module.  In addition, I also switch over to using IS_ENABLED() to
      check if CONFIG_NFS_V3 or CONFIG_NFS_V3_MODULE are set.
      
      The module (nfs3.ko) will be created in the same directory as nfs.ko and
      will be automatically loaded the first time you try to mount over NFS v3.
      Signed-off-by: NBryan Schumaker <bjschuma@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      1c606fb7
    • B
      NFS: Convert v2 into a module · ddda8e0a
      Bryan Schumaker 提交于
      The module (nfs2.ko) will be created in the same directory as nfs.ko and
      will be automatically loaded the first time you try to mount over NFS v2.
      Signed-off-by: NBryan Schumaker <bjschuma@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      ddda8e0a
    • B
      NFS: Keep module parameters in the generic NFS client · fac1e8e4
      Bryan Schumaker 提交于
      Otherwise we break backwards compatibility when v4 becomes a modules.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      fac1e8e4
    • B
      NFS: Split out remaining NFS v4 inode functions · 19d87ca3
      Bryan Schumaker 提交于
      Somehow I missed this in my previous patch series, but these functions
      are only needed by the v4 code and should be moved to a v4-only file.  I
      wasn't exactly sure where I should put these functions, so I moved them
      into nfs4super.c where I could make them static.
      Signed-off-by: NBryan Schumaker <bjschuma@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      19d87ca3
    • B
      NFS: Pass super operations and xattr handlers in the nfs_subversion · 6a74490d
      Bryan Schumaker 提交于
      I can set all variables in the nfs_fill_super() function, allowing me to
      remove the nfs4_fill_super() function.
      Signed-off-by: NBryan Schumaker <bjschuma@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      6a74490d
    • B
      NFS: Only initialize the ACL client in the v3 case · 1179acc6
      Bryan Schumaker 提交于
      v2 and v4 don't use it, so I create two new nfs_rpc_ops functions to
      initialize the ACL client only when we are using v3.
      Signed-off-by: NBryan Schumaker <bjschuma@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      1179acc6
    • B
      NFS: Create a try_mount rpc op · ff9099f2
      Bryan Schumaker 提交于
      I'm already looking up the nfs subversion in nfs_fs_mount(), so I have
      easy access to rpc_ops that used to be difficult to reach.  This allows
      me to set up a different mount path for NFS v2/3 and NFS v4.
      Signed-off-by: NBryan Schumaker <bjschuma@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      ff9099f2
    • B
      NFS: Remove the NFS v4 xdev mount function · e8f25e6d
      Bryan Schumaker 提交于
      I can now share this code with the v2 and v3 code by using the NFS
      subversion structure.
      Signed-off-by: NBryan Schumaker <bjschuma@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      e8f25e6d
    • B
      NFS: Add version registering framework · ab7017a3
      Bryan Schumaker 提交于
      This patch adds in the code to track multiple versions of the NFS
      protocol.  I created default structures for v2, v3 and v4 so that each
      version can continue to work while I convert them into kernel modules.
      I also removed the const parameter from the rpc_version array so that I
      can change it at runtime.
      Signed-off-by: NBryan Schumaker <bjschuma@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      ab7017a3
    • D
      NFS: Fix a number of bugs in the idmapper · a427b9ec
      David Howells 提交于
      Fix a number of bugs in the NFS idmapper code:
      
       (1) Only registered key types can be passed to the core keys code, so
           register the legacy idmapper key type.
      
           This is a requirement because the unregister function cleans up keys
           belonging to that key type so that there aren't dangling pointers to the
           module left behind - including the key->type pointer.
      
       (2) Rename the legacy key type.  You can't have two key types with the same
           name, and (1) would otherwise require that.
      
       (3) complete_request_key() must be called in the error path of
           nfs_idmap_legacy_upcall().
      
       (4) There is one idmap struct for each nfs_client struct.  This means that
           idmap->idmap_key_cons is shared without the use of a lock.  This is a
           problem because key_instantiate_and_link() - as called indirectly by
           idmap_pipe_downcall() - releases anyone waiting for the key to be
           instantiated.
      
           What happens is that idmap_pipe_downcall() running in the rpc.idmapd
           thread, releases the NFS filesystem in whatever thread that is running in
           to continue.  This may then make another idmapper call, overwriting
           idmap_key_cons before idmap_pipe_downcall() gets the chance to call
           complete_request_key().
      
           I *think* that reading idmap_key_cons only once, before
           key_instantiate_and_link() is called, and then caching the result in a
           variable is sufficient.
      
      Bug (4) is the cause of:
      
      BUG: unable to handle kernel NULL pointer dereference at           (null)
      IP: [<          (null)>]           (null)
      PGD 0
      Oops: 0010 [#1] SMP
      CPU 1
      Modules linked in: ppdev parport_pc lp parport ip6table_filter ip6_tables ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack nfs fscache xt_CHECKSUM auth_rpcgss iptable_mangle nfs_acl bridge stp llc lockd be2iscsi iscsi_boot_sysfs bnx2i cnic uio cxgb4i cxgb4 cxgb3i libcxgbi cxgb3 mdio ib_iser rdma_cm ib_cm iw_cm ib_sa ib_mad ib_core ib_addr iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi snd_hda_codec_realtek snd_usb_audio snd_hda_intel snd_hda_codec snd_seq snd_pcm snd_hwdep snd_usbmidi_lib snd_rawmidi snd_timer uvcvideo videobuf2_core videodev media videobuf2_vmalloc snd_seq_device videobuf2_memops e1000e vhost_net iTCO_wdt joydev coretemp snd soundcore macvtap macvlan i2c_i801 snd_page_alloc tun iTCO_vendor_support microcode kvm_intel kvm sunrpc hid_logitech_dj usb_storage i915 drm_kms_helper drm i2c_algo_bit i2c_core video [last unloaded: scsi_wait_scan]
      Pid: 1229, comm: rpc.idmapd Not tainted 3.4.2-1.fc16.x86_64 #1 Gateway DX4710-UB801A/G33M05G1
      RIP: 0010:[<0000000000000000>]  [<          (null)>]           (null)
      RSP: 0018:ffff8801a3645d40  EFLAGS: 00010246
      RAX: ffff880077707e30 RBX: ffff880077707f50 RCX: ffff8801a18ccd80
      RDX: 0000000000000006 RSI: ffff8801a3645e75 RDI: ffff880077707f50
      RBP: ffff8801a3645d88 R08: ffff8801a430f9c0 R09: ffff8801a3645db0
      R10: 000000000000000a R11: 0000000000000246 R12: ffff8801a18ccd80
      R13: ffff8801a3645e75 R14: ffff8801a430f9c0 R15: 0000000000000006
      FS:  00007fb6fb51a700(0000) GS:ffff8801afc80000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000000 CR3: 00000001a49b0000 CR4: 00000000000027e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process rpc.idmapd (pid: 1229, threadinfo ffff8801a3644000, task ffff8801a3bf9710)
      Stack:
       ffffffff81260878 ffff8801a3645db0 ffff8801a3645db0 ffff880077707a90
       ffff880077707f50 ffff8801a18ccd80 0000000000000006 ffff8801a3645e75
       ffff8801a430f9c0 ffff8801a3645dd8 ffffffff81260983 ffff8801a3645de8
      Call Trace:
       [<ffffffff81260878>] ? __key_instantiate_and_link+0x58/0x100
       [<ffffffff81260983>] key_instantiate_and_link+0x63/0xa0
       [<ffffffffa057062b>] idmap_pipe_downcall+0x1cb/0x1e0 [nfs]
       [<ffffffffa0107f57>] rpc_pipe_write+0x67/0x90 [sunrpc]
       [<ffffffff8117f833>] vfs_write+0xb3/0x180
       [<ffffffff8117fb5a>] sys_write+0x4a/0x90
       [<ffffffff81600329>] system_call_fastpath+0x16/0x1b
      Code:  Bad RIP value.
      RIP  [<          (null)>]           (null)
       RSP <ffff8801a3645d40>
      CR2: 0000000000000000
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Reviewed-by: NSteve Dickson <steved@redhat.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Cc: stable@vger.kernel.org [>= 3.4]
      a427b9ec