1. 15 1月, 2020 15 次提交
  2. 18 11月, 2019 1 次提交
  3. 25 9月, 2019 1 次提交
    • T
      NFS: Optimise the default readahead size · c128e575
      Trond Myklebust 提交于
      In the years since the max readahead size was fixed in NFS, a number of
      things have happened:
      - Users can now set the value directly using /sys/class/bdi
      - NFS max supported block sizes have increased by several orders of
        magnitude from 64K to 1MB.
      - Disk access latencies are orders of magnitude faster due to SSD + NVME.
      
      In particular note that if the server is advertising 1MB as the optimal
      read size, as that will set the readahead size to 15MB.
      Let's therefore adjust down, and try to default to VM_READAHEAD_PAGES.
      However let's inform the VM about our preferred block size so that it
      can choose to round up in cases where that makes sense.
      Reported-by: NAlkis Georgopoulos <alkisg@gmail.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      c128e575
  4. 30 8月, 2019 1 次提交
  5. 05 8月, 2019 1 次提交
  6. 13 7月, 2019 2 次提交
  7. 07 7月, 2019 3 次提交
  8. 05 7月, 2019 1 次提交
  9. 21 5月, 2019 1 次提交
  10. 02 5月, 2019 1 次提交
  11. 27 4月, 2019 1 次提交
  12. 26 4月, 2019 1 次提交
  13. 12 4月, 2019 1 次提交
  14. 21 2月, 2019 1 次提交
  15. 29 1月, 2019 1 次提交
    • Y
      nfs: Fix NULL pointer dereference of dev_name · 80ff0017
      Yao Liu 提交于
      There is a NULL pointer dereference of dev_name in nfs_parse_devname()
      
      The oops looks something like:
      
        BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
        ...
        RIP: 0010:nfs_fs_mount+0x3b6/0xc20 [nfs]
        ...
        Call Trace:
         ? ida_alloc_range+0x34b/0x3d0
         ? nfs_clone_super+0x80/0x80 [nfs]
         ? nfs_free_parsed_mount_data+0x60/0x60 [nfs]
         mount_fs+0x52/0x170
         ? __init_waitqueue_head+0x3b/0x50
         vfs_kern_mount+0x6b/0x170
         do_mount+0x216/0xdc0
         ksys_mount+0x83/0xd0
         __x64_sys_mount+0x25/0x30
         do_syscall_64+0x65/0x220
         entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      Fix this by adding a NULL check on dev_name
      Signed-off-by: NYao Liu <yotta.liu@ucloud.cn>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      80ff0017
  16. 03 1月, 2019 1 次提交
    • C
      NFS: Make "port=" mount option optional for RDMA mounts · 0dfbb5f0
      Chuck Lever 提交于
      Having to specify "proto=rdma,port=20049" is cumbersome.
      
      RFC 8267 Section 6.3 requires NFSv4 clients to use "the alternative
      well-known port number", which is 20049. Make the use of the well-
      known port number automatic, just as it is for NFS/TCP and port
      2049.
      
      For NFSv2/3, Section 4.2 allows clients to simply choose 20049 as
      the default or use rpcbind. I don't know of an NFS/RDMA server
      implementation that registers it's NFS/RDMA service with rpcbind,
      so automatically choosing 20049 seems like the better choice. The
      other widely-deployed NFS/RDMA client, Solaris, also uses 20049
      as the default port.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      0dfbb5f0
  17. 22 12月, 2018 5 次提交
    • C
      NFS: nfs_compare_mount_options always compare auth flavors. · 594d1644
      Chris Perl 提交于
      This patch removes the check from nfs_compare_mount_options to see if a
      `sec' option was passed for the current mount before comparing auth
      flavors and instead just always compares auth flavors.
      
      Consider the following scenario:
      
      You have a server with the address 192.168.1.1 and two exports /export/a
      and /export/b.  The first export supports `sys' and `krb5' security, the
      second just `sys'.
      
      Assume you start with no mounts from the server.
      
      The following results in EIOs being returned as the kernel nfs client
      incorrectly thinks it can share the underlying `struct nfs_server's:
      
      $ mkdir /tmp/{a,b}
      $ sudo mount -t nfs -o vers=3,sec=krb5 192.168.1.1:/export/a /tmp/a
      $ sudo mount -t nfs -o vers=3          192.168.1.1:/export/b /tmp/b
      $ df >/dev/null
      df: ‘/tmp/b’: Input/output error
      Signed-off-by: NChris Perl <cperl@janestreet.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      594d1644
    • A
      LSM: new method: ->sb_add_mnt_opt() · 757cbe59
      Al Viro 提交于
      Adding options to growing mnt_opts.  NFS kludge with passing
      context= down into non-text-options mount switched to it, and
      with that the last use of ->sb_parse_opts_str() is gone.
      Reviewed-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      757cbe59
    • A
      LSM: hide struct security_mnt_opts from any generic code · 204cc0cc
      Al Viro 提交于
      Keep void * instead, allocate on demand (in parse_str_opts, at the
      moment).  Eventually both selinux and smack will be better off
      with private structures with several strings in those, rather than
      this "counter and two pointers to dynamically allocated arrays"
      ugliness.  This commit allows to do that at leisure, without
      disrupting anything outside of given module.
      
      Changes:
      	* instead of struct security_mnt_opt use an opaque pointer
      initialized to NULL.
      	* security_sb_eat_lsm_opts(), security_sb_parse_opts_str() and
      security_free_mnt_opts() take it as var argument (i.e. as void **);
      call sites are unchanged.
      	* security_sb_set_mnt_opts() and security_sb_remount() take
      it by value (i.e. as void *).
      	* new method: ->sb_free_mnt_opts().  Takes void *, does
      whatever freeing that needs to be done.
      	* ->sb_set_mnt_opts() and ->sb_remount() might get NULL as
      mnt_opts argument, meaning "empty".
      Reviewed-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      204cc0cc
    • A
      nfs_remount(): don't leak, don't ignore LSM options quietly · 6a0440e5
      Al Viro 提交于
      * if mount(2) passes something like "context=foo" with MS_REMOUNT
      in flags (/sbin/mount.nfs will _not_ do that - you need to issue
      the syscall manually), you'll get leaked copies for LSM options.
      The reason is that instead of nfs_{alloc,free}_parsed_mount_data()
      nfs_remount() uses kzalloc/kfree, which lacks the needed cleanup.
      
      * selinux options are not changed on remount (as for any other
      fs), but in case of NFS the failure is quiet - they are not compared
      to what we used to have, with complaint in case of attempted changes.
      Trivially fixed by converting to use of security_sb_remount().
      Reviewed-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6a0440e5
    • A
      new helper: security_sb_eat_lsm_opts() · f5c0c26d
      Al Viro 提交于
      combination of alloc_secdata(), security_sb_copy_data(),
      security_sb_parse_opt_str() and free_secdata().
      Reviewed-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      f5c0c26d
  18. 01 8月, 2018 2 次提交
    • D
      NFS: silence a harmless uninitialized variable warning · 379ebf07
      Dan Carpenter 提交于
      kstrtoul() can return -ERANGE so Smatch complains that "num" can be
      uninitialized.  We check that it's within bounds so it's not a huge
      deal.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      379ebf07
    • D
      sunrpc: Change rpc_print_iostats to rpc_clnt_show_stats and handle rpc_clnt clones · 016583d7
      Dave Wysochanski 提交于
      The existing rpc_print_iostats has a few shortcomings.  First, the naming
      is not consistent with other functions in the kernel that display stats.
      Second, it is really displaying stats for an rpc_clnt structure as it
      displays both xprt stats and per-op stats.  Third, it does not handle
      rpc_clnt clones, which is important for the one in-kernel tree caller
      of this function, the NFS client's nfs_show_stats function.
      
      Fix all of the above by renaming the rpc_print_iostats to
      rpc_clnt_show_stats and looping through any rpc_clnt clones via
      cl_parent.
      
      Once this interface is fixed, this addresses a problem with NFSv4.
      Before this patch, the /proc/self/mountstats always showed incorrect
      counts for NFSv4 lease and session related opcodes such as SEQUENCE,
      RENEW, SETCLIENTID, CREATE_SESSION, etc.  These counts were always 0
      even though many ops would go over the wire.  The reason for this is
      there are multiple rpc_clnt structures allocated for any given NFSv4
      mount, and inside nfs_show_stats() we callled into rpc_print_iostats()
      which only handled one of them, nfs_server->client.  Fix these counts
      by calling sunrpc's new rpc_clnt_show_stats() function, which handles
      cloned rpc_clnt structs and prints the stats together.
      
      Note that one side-effect of the above is that multiple mounts from
      the same NFS server will show identical counts in the above ops due
      to the fact the one rpc_clnt (representing the NFSv4 client state)
      is shared across mounts.
      Signed-off-by: NDave Wysochanski <dwysocha@redhat.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      016583d7