1. 15 8月, 2017 19 次提交
  2. 14 7月, 2017 2 次提交
  3. 09 5月, 2017 1 次提交
  4. 27 4月, 2017 1 次提交
  5. 26 4月, 2017 1 次提交
  6. 21 4月, 2017 4 次提交
    • J
      nfs: Convert to separately allocated bdi · 0db10944
      Jan Kara 提交于
      Allocate struct backing_dev_info separately instead of embedding it
      inside the superblock. This unifies handling of bdi among users.
      
      CC: Anna Schumaker <anna.schumaker@netapp.com>
      CC: linux-nfs@vger.kernel.org
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      Acked-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      0db10944
    • B
      NFS: move rw_mode to nfs_pageio_header · fbe77c30
      Benjamin Coddington 提交于
      Let's try to have it in a cacheline in nfs4_proc_pgio_rpc_prepare().
      Signed-off-by: NBenjamin Coddington <bcodding@redhat.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      fbe77c30
    • F
      NFS: Fix use after free in write error path · 1f84ccdf
      Fred Isaman 提交于
      Signed-off-by: NFred Isaman <fred.isaman@gmail.com>
      Fixes: 0bcbf039 ("nfs: handle request add failure properly")
      Cc: stable@vger.kernel.org # v4.5+
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      1f84ccdf
    • N
      NFS: fix usage of mempools. · 518662e0
      NeilBrown 提交于
      When passed GFP flags that allow sleeping (such as
      GFP_NOIO), mempool_alloc() will never return NULL, it will
      wait until memory is available.
      
      This means that we don't need to handle failure, but that we
      do need to ensure one thread doesn't call mempool_alloc()
      twice on the one pool without queuing or freeing the first
      allocation.  If multiple threads did this during times of
      high memory pressure, the pool could be exhausted and a
      deadlock could result.
      
      pnfs_generic_alloc_ds_commits() attempts to allocate from
      the nfs_commit_mempool while already holding an allocation
      from that pool.  This is not safe.  So change
      nfs_commitdata_alloc() to take a flag that indicates whether
      failure is acceptable.
      
      In pnfs_generic_alloc_ds_commits(), accept failure and
      handle it as we currently do.  Else where, do not accept
      failure, and do not handle it.
      
      Even when failure is acceptable, we want to succeed if
      possible.  That means both
       - using an entry from the pool if there is one
       - waiting for direct reclaim is there isn't.
      
      We call mempool_alloc(GFP_NOWAIT) to achieve the first, then
      kmem_cache_alloc(GFP_NOIO|__GFP_NORETRY) to achieve the
      second.  Each of these can fail, but together they do the
      best they can without blocking indefinitely.
      
      The objects returned by kmem_cache_alloc() will still be freed
      by mempool_free().  This is safe as mempool_alloc() uses
      exactly the same function to allocate objects (since the mempool
      was created with mempool_create_slab_pool()).  The object returned
      by mempool_alloc() and kmem_cache_alloc() are indistinguishable
      so mempool_free() will handle both identically, either adding to the
      pool or calling kmem_cache_free().
      
      Also, don't test for failure when allocating from
      nfs_wdata_mempool.
      Signed-off-by: NNeilBrown <neilb@suse.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      518662e0
  7. 18 3月, 2017 1 次提交
    • K
      NFS: fix the fault nrequests decreasing for nfs_inode COPY · 38a33101
      Kinglong Mee 提交于
      The nfs_commit_file for NFSv4.2's COPY operation goes through
      the commit path for normal WRITE, but without increase nrequests,
      so, the nrequests decreased in nfs_commit_release_pages is fault.
      After that, the nrequests will be wrong.
      
      [ 5670.299881] ------------[ cut here ]------------
      [ 5670.300295] WARNING: CPU: 0 PID: 27656 at fs/nfs/inode.c:127 nfs_clear_inode+0x66/0x90 [nfs]
      [ 5670.300558] Modules linked in: nfsv4(E) nfs(E) fscache(E) tun bridge stp llc fuse ip_set nfnetlink vmw_vsock_vmci_transport vsock snd_seq_midi snd_seq_midi_event ppdev f2fs coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_ens1371 intel_rapl_perf gameport snd_ac97_codec vmw_balloon ac97_bus snd_seq snd_pcm joydev snd_rawmidi snd_timer snd_seq_device snd soundcore nfit parport_pc parport acpi_cpufreq tpm_tis tpm_tis_core tpm i2c_piix4 vmw_vmci shpchp nfsd auth_rpcgss nfs_acl lockd grace sunrpc xfs libcrc32c vmwgfx drm_kms_helper ttm drm e1000 crc32c_intel mptspi scsi_transport_spi serio_raw mptscsih mptbase ata_generic pata_acpi fjes [last unloaded: fscache]
      [ 5670.302925] CPU: 0 PID: 27656 Comm: umount.nfs4 Tainted: G        W   E   4.11.0-rc1+ #519
      [ 5670.303292] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/02/2015
      [ 5670.304094] Call Trace:
      [ 5670.304510]  dump_stack+0x63/0x86
      [ 5670.304917]  __warn+0xcb/0xf0
      [ 5670.305276]  warn_slowpath_null+0x1d/0x20
      [ 5670.305661]  nfs_clear_inode+0x66/0x90 [nfs]
      [ 5670.306093]  nfs4_evict_inode+0x61/0x70 [nfsv4]
      [ 5670.306480]  evict+0xbb/0x1c0
      [ 5670.306888]  dispose_list+0x4d/0x70
      [ 5670.307233]  evict_inodes+0x178/0x1a0
      [ 5670.307579]  generic_shutdown_super+0x44/0xf0
      [ 5670.307985]  nfs_kill_super+0x21/0x40 [nfs]
      [ 5670.308325]  deactivate_locked_super+0x43/0x70
      [ 5670.308698]  deactivate_super+0x5a/0x60
      [ 5670.309036]  cleanup_mnt+0x3f/0x90
      [ 5670.309407]  __cleanup_mnt+0x12/0x20
      [ 5670.309837]  task_work_run+0x80/0xa0
      [ 5670.310162]  exit_to_usermode_loop+0x89/0x90
      [ 5670.310497]  syscall_return_slowpath+0xaa/0xb0
      [ 5670.310875]  entry_SYSCALL_64_fastpath+0xa7/0xa9
      [ 5670.311197] RIP: 0033:0x7f1bb3617fe7
      [ 5670.311545] RSP: 002b:00007ffecbabb828 EFLAGS: 00000206 ORIG_RAX: 00000000000000a6
      [ 5670.311906] RAX: 0000000000000000 RBX: 0000000001dca1f0 RCX: 00007f1bb3617fe7
      [ 5670.312239] RDX: 000000000000000c RSI: 0000000000000001 RDI: 0000000001dc83c0
      [ 5670.312653] RBP: 0000000001dc83c0 R08: 0000000000000001 R09: 0000000000000000
      [ 5670.312998] R10: 0000000000000755 R11: 0000000000000206 R12: 00007ffecbabc66a
      [ 5670.313335] R13: 0000000001dc83a0 R14: 0000000000000000 R15: 0000000000000000
      [ 5670.313758] ---[ end trace bf4bfe7764e4eb40 ]---
      
      Cc: linux-kernel@vger.kernel.org
      Fixes: 67911c8f ("NFS: Add nfs_commit_file()")
      Signed-off-by: NKinglong Mee <kinglongmee@gmail.com>
      Cc: stable@vger.kernel.org # 4.7+
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      38a33101
  8. 23 2月, 2017 1 次提交
  9. 09 2月, 2017 1 次提交
  10. 31 1月, 2017 1 次提交
  11. 25 12月, 2016 1 次提交
  12. 02 12月, 2016 2 次提交
  13. 08 10月, 2016 1 次提交
  14. 29 7月, 2016 1 次提交
  15. 23 7月, 2016 1 次提交
  16. 20 7月, 2016 1 次提交
    • S
      sunrpc: move NO_CRKEY_TIMEOUT to the auth->au_flags · ce52914e
      Scott Mayhew 提交于
      A generic_cred can be used to look up a unx_cred or a gss_cred, so it's
      not really safe to use the the generic_cred->acred->ac_flags to store
      the NO_CRKEY_TIMEOUT flag.  A lookup for a unx_cred triggered while the
      KEY_EXPIRE_SOON flag is already set will cause both NO_CRKEY_TIMEOUT and
      KEY_EXPIRE_SOON to be set in the ac_flags, leaving the user associated
      with the auth_cred to be in a state where they're perpetually doing 4K
      NFS_FILE_SYNC writes.
      
      This can be reproduced as follows:
      
      1. Mount two NFS filesystems, one with sec=krb5 and one with sec=sys.
      They do not need to be the same export, nor do they even need to be from
      the same NFS server.  Also, v3 is fine.
      $ sudo mount -o v3,sec=krb5 server1:/export /mnt/krb5
      $ sudo mount -o v3,sec=sys server2:/export /mnt/sys
      
      2. As the normal user, before accessing the kerberized mount, kinit with
      a short lifetime (but not so short that renewing the ticket would leave
      you within the 4-minute window again by the time the original ticket
      expires), e.g.
      $ kinit -l 10m -r 60m
      
      3. Do some I/O to the kerberized mount and verify that the writes are
      wsize, UNSTABLE:
      $ dd if=/dev/zero of=/mnt/krb5/file bs=1M count=1
      
      4. Wait until you're within 4 minutes of key expiry, then do some more
      I/O to the kerberized mount to ensure that RPC_CRED_KEY_EXPIRE_SOON gets
      set.  Verify that the writes are 4K, FILE_SYNC:
      $ dd if=/dev/zero of=/mnt/krb5/file bs=1M count=1
      
      5. Now do some I/O to the sec=sys mount.  This will cause
      RPC_CRED_NO_CRKEY_TIMEOUT to be set:
      $ dd if=/dev/zero of=/mnt/sys/file bs=1M count=1
      
      6. Writes for that user will now be permanently 4K, FILE_SYNC for that
      user, regardless of which mount is being written to, until you reboot
      the client.  Renewing the kerberos ticket (assuming it hasn't already
      expired) will have no effect.  Grabbing a new kerberos ticket at this
      point will have no effect either.
      
      Move the flag to the auth->au_flags field (which is currently unused)
      and rename it slightly to reflect that it's no longer associated with
      the auth_cred->ac_flags.  Add the rpc_auth to the arg list of
      rpcauth_cred_key_to_expire and check the au_flags there too.  Finally,
      add the inode to the arg list of nfs_ctx_key_to_expire so we can
      determine the rpc_auth to pass to rpcauth_cred_key_to_expire.
      Signed-off-by: NScott Mayhew <smayhew@redhat.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      ce52914e
  17. 06 7月, 2016 1 次提交
    • T
      NFSv4.2: Fix writeback races in nfs4_copy_file_range · 837bb1d7
      Trond Myklebust 提交于
      We need to ensure that any writes to the destination file are serialised
      with the copy, meaning that the writeback has to occur under the inode lock.
      
      Also relax the writeback requirement on the source, and rely on the
      stateid checking to tell us if the source rebooted. Add the helper
      nfs_filemap_write_and_wait_range() to call pnfs_sync_inode() as
      is appropriate for pNFS servers that may need a layoutcommit.
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      837bb1d7