1. 14 7月, 2017 2 次提交
  2. 04 6月, 2017 1 次提交
  3. 29 5月, 2017 1 次提交
  4. 24 5月, 2017 4 次提交
    • T
      NFSv4.0: Fix a lock leak in nfs40_walk_client_list · b49c15f9
      Trond Myklebust 提交于
      Xiaolong Ye's kernel test robot detected the following Oops:
      [  299.158991] BUG: scheduling while atomic: mount.nfs/9387/0x00000002
      [  299.169587] 2 locks held by mount.nfs/9387:
      [  299.176165]  #0:  (nfs_clid_init_mutex){......}, at: [<ffffffff8130cc92>] nfs4_discover_server_trunking+0x47/0x1fc
      [  299.201802]  #1:  (&(&nn->nfs_client_lock)->rlock){......}, at: [<ffffffff813125fa>] nfs40_walk_client_list+0x2e9/0x338
      [  299.221979] CPU: 0 PID: 9387 Comm: mount.nfs Not tainted 4.11.0-rc7-00021-g14d1bbb0 #45
      [  299.235584] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.3-20161025_171302-gandalf 04/01/2014
      [  299.251176] Call Trace:
      [  299.255192]  dump_stack+0x61/0x7e
      [  299.260416]  __schedule_bug+0x65/0x74
      [  299.266208]  __schedule+0x5d/0x87c
      [  299.271883]  schedule+0x89/0x9a
      [  299.276937]  schedule_timeout+0x232/0x289
      [  299.283223]  ? detach_if_pending+0x10b/0x10b
      [  299.289935]  schedule_timeout_uninterruptible+0x2a/0x2c
      [  299.298266]  ? put_rpccred+0x3e/0x115
      [  299.304327]  ? schedule_timeout_uninterruptible+0x2a/0x2c
      [  299.312851]  msleep+0x1e/0x22
      [  299.317612]  nfs4_discover_server_trunking+0x102/0x1fc
      [  299.325644]  nfs4_init_client+0x13f/0x194
      
      It looks as if we recently added a spin_lock() leak to
      nfs40_walk_client_list() when cleaning up the code.
      Reported-by: Nkernel test robot <xiaolong.ye@intel.com>
      Fixes: 14d1bbb0 ("NFS: Create a common nfs4_match_client() function")
      Cc: Anna Schumaker <Anna.Schumaker@Netapp.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      b49c15f9
    • B
      pnfs: Fix the check for requests in range of layout segment · 08cb5b0f
      Benjamin Coddington 提交于
      It's possible and acceptable for NFS to attempt to add requests beyond the
      range of the current pgio->pg_lseg, a case which should be caught and
      limited by the pg_test operation.  However, the current handling of this
      case replaces pgio->pg_lseg with a new layout segment (after a WARN) within
      that pg_test operation.  That will cause all the previously added requests
      to be submitted with this new layout segment, which may not be valid for
      those requests.
      
      Fix this problem by only returning zero for the number of bytes to coalesce
      from pg_test for this case which allows any previously added requests to
      complete on the current layout segment.  The check for requests starting
      out of range of the layout segment moves to pg_init, so that the
      replacement of pgio->pg_lseg will be done when the next request is added.
      Signed-off-by: NBenjamin Coddington <bcodding@redhat.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      08cb5b0f
    • D
      pNFS/flexfiles: missing error code in ff_layout_alloc_lseg() · 662f9a10
      Dan Carpenter 提交于
      If xdr_inline_decode() fails then we end up returning ERR_PTR(0).  The
      caller treats NULL returns as -ENOMEM so it doesn't really hurt runtime,
      but obviously we intended to set an error code here.
      
      Fixes: d67ae825 ("pnfs/flexfiles: Add the FlexFile Layout Driver")
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      662f9a10
    • O
      NFS fix COMMIT after COPY · 6d3b5d8d
      Olga Kornievskaia 提交于
      Fix a typo in the commit e0926934
      "NFS append COMMIT after synchronous COPY"
      Reported-by: NEryu Guan <eguan@redhat.com>
      Fixes: e0926934 ("NFS append COMMIT after synchronous COPY")
      Signed-off-by: NOlga Kornievskaia <kolga@netapp.com>
      Tested-by: NEryu Guan <eguan@redhat.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      6d3b5d8d
  5. 10 5月, 2017 2 次提交
  6. 09 5月, 2017 1 次提交
  7. 08 5月, 2017 2 次提交
  8. 06 5月, 2017 4 次提交
  9. 04 5月, 2017 2 次提交
    • J
      nfs: Fix bdi handling for cloned superblocks · 9052c7cf
      Jan Kara 提交于
      In commit 0d3b12584972 "nfs: Convert to separately allocated bdi" I have
      wrongly cloned bdi reference in nfs_clone_super(). Further inspection
      has shown that originally the code was actually allocating a new bdi (in
      ->clone_server callback) which was later registered in
      nfs_fs_mount_common() and used for sb->s_bdi in nfs_initialise_sb().
      This could later result in bdi for the original superblock not getting
      unregistered when that superblock got shutdown (as the cloned sb still
      held bdi reference) and later when a new superblock was created under
      the same anonymous device number, a clash in sysfs has happened on bdi
      registration:
      
      ------------[ cut here ]------------
      WARNING: CPU: 1 PID: 10284 at /linux-next/fs/sysfs/dir.c:31 sysfs_warn_dup+0x64/0x74
      sysfs: cannot create duplicate filename '/devices/virtual/bdi/0:32'
      Modules linked in: axp20x_usb_power gpio_axp209 nvmem_sunxi_sid sun4i_dma sun4i_ss virt_dma
      CPU: 1 PID: 10284 Comm: mount.nfs Not tainted 4.11.0-rc4+ #14
      Hardware name: Allwinner sun7i (A20) Family
      [<c010f19c>] (unwind_backtrace) from [<c010bc74>] (show_stack+0x10/0x14)
      [<c010bc74>] (show_stack) from [<c03c6e24>] (dump_stack+0x78/0x8c)
      [<c03c6e24>] (dump_stack) from [<c0122200>] (__warn+0xe8/0x100)
      [<c0122200>] (__warn) from [<c0122250>] (warn_slowpath_fmt+0x38/0x48)
      [<c0122250>] (warn_slowpath_fmt) from [<c02ac178>] (sysfs_warn_dup+0x64/0x74)
      [<c02ac178>] (sysfs_warn_dup) from [<c02ac254>] (sysfs_create_dir_ns+0x84/0x94)
      [<c02ac254>] (sysfs_create_dir_ns) from [<c03c8b8c>] (kobject_add_internal+0x9c/0x2ec)
      [<c03c8b8c>] (kobject_add_internal) from [<c03c8e24>] (kobject_add+0x48/0x98)
      [<c03c8e24>] (kobject_add) from [<c048d75c>] (device_add+0xe4/0x5a0)
      [<c048d75c>] (device_add) from [<c048ddb4>] (device_create_groups_vargs+0xac/0xbc)
      [<c048ddb4>] (device_create_groups_vargs) from [<c048dde4>] (device_create_vargs+0x20/0x28)
      [<c048dde4>] (device_create_vargs) from [<c02075c8>] (bdi_register_va+0x44/0xfc)
      [<c02075c8>] (bdi_register_va) from [<c023d378>] (super_setup_bdi_name+0x48/0xa4)
      [<c023d378>] (super_setup_bdi_name) from [<c0312ef4>] (nfs_fill_super+0x1a4/0x204)
      [<c0312ef4>] (nfs_fill_super) from [<c03133f0>] (nfs_fs_mount_common+0x140/0x1e8)
      [<c03133f0>] (nfs_fs_mount_common) from [<c03335cc>] (nfs4_remote_mount+0x50/0x58)
      [<c03335cc>] (nfs4_remote_mount) from [<c023ef98>] (mount_fs+0x14/0xa4)
      [<c023ef98>] (mount_fs) from [<c025cba0>] (vfs_kern_mount+0x54/0x128)
      [<c025cba0>] (vfs_kern_mount) from [<c033352c>] (nfs_do_root_mount+0x80/0xa0)
      [<c033352c>] (nfs_do_root_mount) from [<c0333818>] (nfs4_try_mount+0x28/0x3c)
      [<c0333818>] (nfs4_try_mount) from [<c0313874>] (nfs_fs_mount+0x2cc/0x8c4)
      [<c0313874>] (nfs_fs_mount) from [<c023ef98>] (mount_fs+0x14/0xa4)
      [<c023ef98>] (mount_fs) from [<c025cba0>] (vfs_kern_mount+0x54/0x128)
      [<c025cba0>] (vfs_kern_mount) from [<c02600f0>] (do_mount+0x158/0xc7c)
      [<c02600f0>] (do_mount) from [<c0260f98>] (SyS_mount+0x8c/0xb4)
      [<c0260f98>] (SyS_mount) from [<c0107840>] (ret_fast_syscall+0x0/0x3c)
      
      Fix the problem by always creating new bdi for a superblock as we used
      to do.
      Reported-and-tested-by: NCorentin Labbe <clabbe.montjoie@gmail.com>
      Fixes: 0d3b12584972ce5781179ad3f15cca3cdb5cae05
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      9052c7cf
    • F
  10. 03 5月, 2017 3 次提交
  11. 29 4月, 2017 7 次提交
    • T
      pNFS: Ensure we commit the layout if it has been invalidated · 1f18b82c
      Trond Myklebust 提交于
      If the layout is being invalidated on the server, then we must
      invoke nfs_commit_inode() to ensure any commits to the DS get
      cleared out.
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      1f18b82c
    • T
      pNFS: Don't send COMMITs to the DSes if the server invalidated our layout · 722f0b89
      Trond Myklebust 提交于
      If the layout was invalidated, then assume we should requeue all the
      pending writes for the DS in question.
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      722f0b89
    • T
      pNFS/flexfiles: Fix up the ff_layout_write_pagelist failure path · 37f8aa16
      Trond Myklebust 提交于
      If the attempt to write through pNFS fails, we need to use the same
      failure semantics as for the read path: If the FF_FLAGS_NO_IO_THRU_MDS
      flag is set or we have sufficient valid DSes, then we must retry through
      pNFS
      
      Fixes: d67ae825 ("pnfs/flexfiles: Add the FlexFile Layout Driver")
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      37f8aa16
    • T
      pNFS: Ensure we check layout validity before marking it for return · bdebfccd
      Trond Myklebust 提交于
      pnfs_error_mark_layout_for_return needs to check that the layout is
      valid before calling pnfs_set_plh_return_info().
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      bdebfccd
    • O
      NFS4.1 handle interrupted slot reuse from ERR_DELAY · 88bd4f86
      Olga Kornievskaia 提交于
      If the RPC slot was interrupted and server replied to the next
      operation on the "reused" slot with ERR_DELAY, don't clear out
      the "interrupted" flag until we properly recover.
      Signed-off-by: NOlga Kornievskaia <kolga@netapp.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      88bd4f86
    • P
      NFSv4: check return value of xdr_inline_decode · 4edabfd7
      Pan Bian 提交于
      Function xdr_inline_decode() will return a NULL pointer if the input
      buffer does not have long enough buffer to decode nbytes of data.
      However, in function decode_op_map(), the return value of
      xdr_inline_decode() is not validated before it is used. This patch adds
      a check to the return value of xdr_inline_decode().
      Signed-off-by: NPan Bian <bianpan2016@163.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      4edabfd7
    • A
      nfs/filelayout: fix NULL pointer dereference in fl_pnfs_update_layout() · 209aa230
      Artem Savkov 提交于
      Calling pnfs_put_lset on an IS_ERR pointer results in a NULL pointer
      dereference like the one below. At the same time the check of retvalue
      of filelayout_check_deviceid() sets lseg to error, but does not free it
      before that.
      
      [ 3000.636161] BUG: unable to handle kernel NULL pointer dereference at 000000000000003c
      [ 3000.636970] IP: pnfs_put_lseg+0x29/0x100 [nfsv4]
      [ 3000.637420] PGD 4f23b067
      [ 3000.637421] PUD 4a0f4067
      [ 3000.637679] PMD 0
      [ 3000.637937]
      [ 3000.638287] Oops: 0000 [#1] SMP
      [ 3000.638591] Modules linked in: nfs_layout_nfsv41_files nfsv3 nfnetlink_queue nfnetlink_log nfnetlink bluetooth rfkill rpcsec_gss_krb5 nfsv4 nfs fscache binfmt_misc arc4 md4 nls_utf8 cifs ccm dns_resolver rpcrdma ib_isert iscsi_target_mod ib_iser rdma_cm iw_cm libiscsi scsi_transport_iscsi ib_srpt target_core_mod ib_srp scsi_transport_srp ib_ipoib ib_ucm ib_uverbs ib_umad ib_cm ib_core nls_koi8_u nls_cp932 ts_kmp nf_conntrack_ipv4 nf_defrag_ipv4 nf_conntrack crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcspkr virtio_balloon ppdev virtio_rng parport_pc i2c_piix4 parport acpi_cpufreq nfsd auth_rpcgss nfs_acl lockd grace sunrpc xfs libcrc32c ata_generic pata_acpi virtio_blk virtio_net cirrus drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops crc32c_intel ata_piix ttm libata drm serio_raw
      [ 3000.645245]  i2c_core virtio_pci virtio_ring virtio floppy dm_mirror dm_region_hash dm_log dm_mod [last unloaded: xt_u32]
      [ 3000.646360] CPU: 1 PID: 26402 Comm: date Not tainted 4.11.0-rc7.1.el7.test.x86_64 #1
      [ 3000.647092] Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011
      [ 3000.647638] task: ffff8800415ada00 task.stack: ffffc90000ff0000
      [ 3000.648207] RIP: 0010:pnfs_put_lseg+0x29/0x100 [nfsv4]
      [ 3000.648696] RSP: 0018:ffffc90000ff39b8 EFLAGS: 00010246
      [ 3000.649193] RAX: 0000000000000000 RBX: fffffffffffffff4 RCX: 00000000000d43be
      [ 3000.649859] RDX: 00000000000d43bd RSI: 0000000000000000 RDI: fffffffffffffff4
      [ 3000.650530] RBP: ffffc90000ff39d8 R08: 000000000001e320 R09: ffffffffa05c35ce
      [ 3000.651203] R10: ffff88007fd1e320 R11: ffffea0001283d80 R12: 0000000001400040
      [ 3000.651875] R13: ffff88004f77d9f0 R14: ffffc90000ff3cd8 R15: ffff8800417ade00
      [ 3000.652546] FS:  00007fac4d5cd740(0000) GS:ffff88007fd00000(0000) knlGS:0000000000000000
      [ 3000.653304] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 3000.653849] CR2: 000000000000003c CR3: 000000004f080000 CR4: 00000000000406e0
      [ 3000.654527] Call Trace:
      [ 3000.654771]  fl_pnfs_update_layout.constprop.20+0x10c/0x150 [nfs_layout_nfsv41_files]
      [ 3000.655505]  filelayout_pg_init_write+0x21d/0x270 [nfs_layout_nfsv41_files]
      [ 3000.656195]  __nfs_pageio_add_request+0x11c/0x490 [nfs]
      [ 3000.656698]  nfs_pageio_add_request+0xac/0x260 [nfs]
      [ 3000.657180]  nfs_do_writepage+0x109/0x2e0 [nfs]
      [ 3000.657616]  nfs_writepages_callback+0x16/0x30 [nfs]
      [ 3000.658096]  write_cache_pages+0x26f/0x510
      [ 3000.658495]  ? nfs_do_writepage+0x2e0/0x2e0 [nfs]
      [ 3000.658946]  ? _raw_spin_unlock_bh+0x1e/0x20
      [ 3000.659357]  ? wb_wakeup_delayed+0x5f/0x70
      [ 3000.659748]  ? __mark_inode_dirty+0x2eb/0x360
      [ 3000.660170]  nfs_writepages+0x84/0xd0 [nfs]
      [ 3000.660575]  ? nfs_updatepage+0x571/0xb70 [nfs]
      [ 3000.661012]  do_writepages+0x1e/0x30
      [ 3000.661358]  __filemap_fdatawrite_range+0xc6/0x100
      [ 3000.661819]  filemap_write_and_wait_range+0x41/0x90
      [ 3000.662292]  nfs_file_fsync+0x34/0x1f0 [nfs]
      [ 3000.662704]  vfs_fsync_range+0x3d/0xb0
      [ 3000.663065]  vfs_fsync+0x1c/0x20
      [ 3000.663385]  nfs4_file_flush+0x57/0x80 [nfsv4]
      [ 3000.663813]  filp_close+0x2f/0x70
      [ 3000.664132]  __close_fd+0x9a/0xc0
      [ 3000.664453]  SyS_close+0x23/0x50
      [ 3000.664785]  do_syscall_64+0x67/0x180
      [ 3000.665162]  entry_SYSCALL64_slow_path+0x25/0x25
      [ 3000.665600] RIP: 0033:0x7fac4d0e1e90
      [ 3000.665946] RSP: 002b:00007ffd54e90c88 EFLAGS: 00000246 ORIG_RAX: 0000000000000003
      [ 3000.666679] RAX: ffffffffffffffda RBX: 00007fac4d3b5400 RCX: 00007fac4d0e1e90
      [ 3000.667349] RDX: 0000000000000000 RSI: 00007fac4d5d9000 RDI: 0000000000000001
      [ 3000.668031] RBP: 0000000000000000 R08: 00007fac4d3b6a00 R09: 00007fac4d5cd740
      [ 3000.668709] R10: 00007ffd54e909e0 R11: 0000000000000246 R12: 0000000000000000
      [ 3000.669385] R13: 00007fac4d3b5e80 R14: 0000000000000000 R15: 0000000000000000
      [ 3000.670061] Code: 00 00 66 66 66 66 90 55 48 85 ff 48 89 e5 41 56 41 55 41 54 53 48 89 fb 0f 84 97 00 00 00 f6 05 16 8f bc ff 10 0f 85 a6 00 00 00 <4c> 8b 63 48 48 8d 7b 38 49 8b 84 24 90 00 00 00 4c 8d a8 88 00
      [ 3000.671831] RIP: pnfs_put_lseg+0x29/0x100 [nfsv4] RSP: ffffc90000ff39b8
      [ 3000.672462] CR2: 000000000000003c
      Signed-off-by: NArtem Savkov <asavkov@redhat.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      209aa230
  12. 28 4月, 2017 2 次提交
    • T
      NFSv4: Fix callback server shutdown · ed6473dd
      Trond Myklebust 提交于
      We want to use kthread_stop() in order to ensure the threads are
      shut down before we tear down the nfs_callback_info in nfs_callback_down.
      Tested-and-reviewed-by: NKinglong Mee <kinglongmee@gmail.com>
      Reported-by: NKinglong Mee <kinglongmee@gmail.com>
      Fixes: bb6aeba7 ("NFSv4.x: Switch to using svc_set_num_threads()...")
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      ed6473dd
    • K
      NFSv4.x/callback: Create the callback service through svc_create_pooled · df807fff
      Kinglong Mee 提交于
      As the comments for svc_set_num_threads() said,
      " Destroying threads relies on the service threads filling in
      rqstp->rq_task, which only the nfs ones do.  Assumes the serv
      has been created using svc_create_pooled()."
      
      If creating service through svc_create(), the svc_pool_map_put()
      will be called in svc_destroy(), but the pool map isn't used.
      So that, the reference of pool map will be drop, the next using
      of pool map will get a zero npools.
      
      [  137.992130] divide error: 0000 [#1] SMP
      [  137.992148] Modules linked in: nfsd(E) nfsv4 nfs fscache fuse tun bridge stp llc ip_set nfnetlink vmw_vsock_vmci_transport vsock snd_seq_midi snd_seq_midi_event vmw_balloon coretemp crct10dif_pclmul crc32_pclmul ppdev ghash_clmulni_intel intel_rapl_perf joydev snd_ens1371 gameport snd_ac97_codec ac97_bus snd_seq snd_pcm snd_rawmidi snd_timer snd_seq_device snd soundcore parport_pc parport nfit acpi_cpufreq tpm_tis tpm_tis_core tpm vmw_vmci i2c_piix4 shpchp auth_rpcgss nfs_acl lockd(E) grace sunrpc(E) xfs libcrc32c vmwgfx drm_kms_helper ttm crc32c_intel drm e1000 mptspi scsi_transport_spi serio_raw mptscsih mptbase ata_generic pata_acpi [last unloaded: nfsd]
      [  137.992336] CPU: 0 PID: 4514 Comm: rpc.nfsd Tainted: G            E   4.11.0-rc8+ #536
      [  137.992777] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/02/2015
      [  137.993757] task: ffff955984101d00 task.stack: ffff9873c2604000
      [  137.994231] RIP: 0010:svc_pool_for_cpu+0x2b/0x80 [sunrpc]
      [  137.994768] RSP: 0018:ffff9873c2607c18 EFLAGS: 00010246
      [  137.995227] RAX: 0000000000000000 RBX: ffff95598376f000 RCX: 0000000000000002
      [  137.995673] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff9559944aec00
      [  137.996156] RBP: ffff9873c2607c18 R08: ffff9559944aec28 R09: 0000000000000000
      [  137.996609] R10: 0000000001080002 R11: 0000000000000000 R12: ffff95598376f010
      [  137.997063] R13: ffff95598376f018 R14: ffff9559944aec28 R15: ffff9559944aec00
      [  137.997584] FS:  00007f755529eb40(0000) GS:ffff9559bb600000(0000) knlGS:0000000000000000
      [  137.998048] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  137.998548] CR2: 000055f3aecd9660 CR3: 0000000084290000 CR4: 00000000001406f0
      [  137.999052] Call Trace:
      [  137.999517]  svc_xprt_do_enqueue+0xef/0x260 [sunrpc]
      [  138.000028]  svc_xprt_received+0x47/0x90 [sunrpc]
      [  138.000487]  svc_add_new_perm_xprt+0x76/0x90 [sunrpc]
      [  138.000981]  svc_addsock+0x14b/0x200 [sunrpc]
      [  138.001424]  ? recalc_sigpending+0x1b/0x50
      [  138.001860]  ? __getnstimeofday64+0x41/0xd0
      [  138.002346]  ? do_gettimeofday+0x29/0x90
      [  138.002779]  write_ports+0x255/0x2c0 [nfsd]
      [  138.003202]  ? _copy_from_user+0x4e/0x80
      [  138.003676]  ? write_recoverydir+0x100/0x100 [nfsd]
      [  138.004098]  nfsctl_transaction_write+0x48/0x80 [nfsd]
      [  138.004544]  __vfs_write+0x37/0x160
      [  138.004982]  ? selinux_file_permission+0xd7/0x110
      [  138.005401]  ? security_file_permission+0x3b/0xc0
      [  138.005865]  vfs_write+0xb5/0x1a0
      [  138.006267]  SyS_write+0x55/0xc0
      [  138.006654]  entry_SYSCALL_64_fastpath+0x1a/0xa9
      [  138.007071] RIP: 0033:0x7f7554b9dc30
      [  138.007437] RSP: 002b:00007ffc9f92c788 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
      [  138.007807] RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f7554b9dc30
      [  138.008168] RDX: 0000000000000002 RSI: 00005640cd536640 RDI: 0000000000000003
      [  138.008573] RBP: 00007ffc9f92c780 R08: 0000000000000001 R09: 0000000000000002
      [  138.008918] R10: 0000000000000064 R11: 0000000000000246 R12: 0000000000000004
      [  138.009254] R13: 00005640cdbf77a0 R14: 00005640cdbf7720 R15: 00007ffc9f92c238
      [  138.009610] Code: 0f 1f 44 00 00 48 8b 87 98 00 00 00 55 48 89 e5 48 83 78 08 00 74 10 8b 05 07 42 02 00 83 f8 01 74 40 83 f8 02 74 19 31 c0 31 d2 <f7> b7 88 00 00 00 5d 89 d0 48 c1 e0 07 48 03 87 90 00 00 00 c3
      [  138.010664] RIP: svc_pool_for_cpu+0x2b/0x80 [sunrpc] RSP: ffff9873c2607c18
      [  138.011061] ---[ end trace b3468224cafa7d11 ]---
      Signed-off-by: NKinglong Mee <kinglongmee@gmail.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      df807fff
  13. 27 4月, 2017 2 次提交
  14. 26 4月, 2017 3 次提交
  15. 25 4月, 2017 1 次提交
  16. 21 4月, 2017 3 次提交
    • B
      NFS: Always wait for I/O completion before unlock · f30cb757
      Benjamin Coddington 提交于
      NFS attempts to wait for read and write completion before unlocking in
      order to ensure that the data returned was protected by the lock.  When
      this waiting is interrupted by a signal, the unlock may be skipped, and
      messages similar to the following are seen in the kernel ring buffer:
      
      [20.167876] Leaked locks on dev=0x0:0x2b ino=0x8dd4c3:
      [20.168286] POSIX: fl_owner=ffff880078b06940 fl_flags=0x1 fl_type=0x0 fl_pid=20183
      [20.168727] POSIX: fl_owner=ffff880078b06680 fl_flags=0x1 fl_type=0x0 fl_pid=20185
      
      For NFSv3, the missing unlock will cause the server to refuse conflicting
      locks indefinitely.  For NFSv4, the leftover lock will be removed by the
      server after the lease timeout.
      
      This patch fixes this issue by skipping the usual wait in
      nfs_iocounter_wait if the FL_CLOSE flag is set when signaled.  Instead, the
      wait happens in the unlock RPC task on the NFS UOC rpc_waitqueue.
      
      For NFSv3, use lockd's new nlmclnt_operations along with
      nfs_async_iocounter_wait to defer NLM's unlock task until the lock
      context's iocounter reaches zero.
      
      For NFSv4, call nfs_async_iocounter_wait() directly from unlock's
      current rpc_call_prepare.
      Signed-off-by: NBenjamin Coddington <bcodding@redhat.com>
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      f30cb757
    • B
      lockd: Introduce nlmclnt_operations · b1ece737
      Benjamin Coddington 提交于
      NFS would enjoy the ability to modify the behavior of the NLM client's
      unlock RPC task in order to delay the transmission of the unlock until IO
      that was submitted under that lock has completed.  This ability can ensure
      that the NLM client will always complete the transmission of an unlock even
      if the waiting caller has been interrupted with fatal signal.
      
      For this purpose, a pointer to a struct nlmclnt_operations can be assigned
      in a nfs_module's nfs_rpc_ops that will install those nlmclnt_operations on
      the nlm_host.  The struct nlmclnt_operations defines three callback
      operations that will be used in a following patch:
      
      nlmclnt_alloc_call - used to call back after a successful allocation of
      	a struct nlm_rqst in nlmclnt_proc().
      
      nlmclnt_unlock_prepare - used to call back during NLM unlock's
      	rpc_call_prepare.  The NLM client defers calling rpc_call_start()
      	until this callback returns false.
      
      nlmclnt_release_call - used to call back when the NLM client's struct
      	nlm_rqst is freed.
      Signed-off-by: NBenjamin Coddington <bcodding@redhat.com>
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      b1ece737
    • B
      NFS: Add an iocounter wait function for async RPC tasks · 7d6ddf88
      Benjamin Coddington 提交于
      By sleeping on a new NFS Unlock-On-Close waitqueue, rpc tasks may wait for
      a lock context's iocounter to reach zero.  The rpc waitqueue is only woken
      when the open_context has the NFS_CONTEXT_UNLOCK flag set in order to
      mitigate spurious wake-ups for any iocounter reaching zero.
      Signed-off-by: NBenjamin Coddington <bcodding@redhat.com>
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      7d6ddf88