1. 18 6月, 2009 1 次提交
  2. 09 5月, 2009 2 次提交
  3. 07 4月, 2009 1 次提交
  4. 03 4月, 2009 3 次提交
    • D
      NFS: Add mount options to enable local caching on NFS · b797cac7
      David Howells 提交于
      Add NFS mount options to allow the local caching support to be enabled.
      
      The attached patch makes it possible for the NFS filesystem to be told to make
      use of the network filesystem local caching service (FS-Cache).
      
      To be able to use this, a recent nfsutils package is required.
      
      There are three variant NFS mount options that can be added to a mount command
      to control caching for a mount.  Only the last one specified takes effect:
      
       (*) Adding "fsc" will request caching.
      
       (*) Adding "fsc=<string>" will request caching and also specify a uniquifier.
      
       (*) Adding "nofsc" will disable caching.
      
      For example:
      
      	mount warthog:/ /a -o fsc
      
      The cache of a particular superblock (NFS FSID) will be shared between all
      mounts of that volume, provided they have the same connection parameters and
      are not marked 'nosharecache'.
      
      Where it is otherwise impossible to distinguish superblocks because all the
      parameters are identical, but the 'nosharecache' option is supplied, a
      uniquifying string must be supplied, else only the first mount will be
      permitted to use the cache.
      
      If there's a key collision, then the second mount will disable caching and give
      a warning into the kernel log.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NSteve Dickson <steved@redhat.com>
      Acked-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Acked-by: NAl Viro <viro@zeniv.linux.org.uk>
      Tested-by: NDaire Byrne <Daire.Byrne@framestore.com>
      b797cac7
    • D
      NFS: Add some new I/O counters for FS-Cache doing things for NFS · 6a51091d
      David Howells 提交于
      Add some new NFS I/O counters for FS-Cache doing things for NFS.  A new line is
      emitted into /proc/pid/mountstats if caching is enabled that looks like:
      
      	fsc: <rok> <rfl> <wok> <wfl> <unc>
      
      Where <rok> is the number of pages read successfully from the cache, <rfl> is
      the number of failed page reads against the cache, <wok> is the number of
      successful page writes to the cache, <wfl> is the number of failed page writes
      to the cache, and <unc> is the number of NFS pages that have been disconnected
      from the cache.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NSteve Dickson <steved@redhat.com>
      Acked-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Acked-by: NAl Viro <viro@zeniv.linux.org.uk>
      Tested-by: NDaire Byrne <Daire.Byrne@framestore.com>
      6a51091d
    • D
      NFS: Define and create superblock-level objects · 08734048
      David Howells 提交于
      Define and create superblock-level cache index objects (as managed by
      nfs_server structs).
      
      Each superblock object is created in a server level index object and is itself
      an index into which inode-level objects are inserted.
      
      Ideally there would be one superblock-level object per server, and the former
      would be folded into the latter; however, since the "nosharecache" option
      exists this isn't possible.
      
      The superblock object key is a sequence consisting of:
      
       (1) Certain superblock s_flags.
      
       (2) Various connection parameters that serve to distinguish superblocks for
           sget().
      
       (3) The volume FSID.
      
       (4) The security flavour.
      
       (5) The uniquifier length.
      
       (6) The uniquifier text.  This is normally an empty string, unless the fsc=xyz
           mount option was used to explicitly specify a uniquifier.
      
      The key blob is of variable length, depending on the length of (6).
      
      The superblock object is given no coherency data to carry in the auxiliary data
      permitted by the cache.  It is assumed that the superblock is always coherent.
      
      This patch also adds uniquification handling such that two otherwise identical
      superblocks, at least one of which is marked "nosharecache", won't end up
      trying to share the on-disk cache.  It will be possible to manually provide a
      uniquifier through a mount option with a later patch to avoid the error
      otherwise produced.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NSteve Dickson <steved@redhat.com>
      Acked-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Acked-by: NAl Viro <viro@zeniv.linux.org.uk>
      Tested-by: NDaire Byrne <Daire.Byrne@framestore.com>
      08734048
  5. 12 3月, 2009 1 次提交
  6. 24 12月, 2008 4 次提交
    • T
      NFSv4: Clean up the support for returning multiple delegations · 515d8611
      Trond Myklebust 提交于
      Add a flag to mark delegations as requiring return, then run a garbage
      collector. In the future, this will allow for more flexible delegation
      management, where delegations may be marked for return if it turns out
      that they are not being referenced.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      515d8611
    • C
      NFS: "[no]resvport" mount option changes mountd client too · 50a737f8
      Chuck Lever 提交于
      If the admin has specified the "noresvport" option for an NFS mount
      point, the kernel's NFS client uses an unprivileged source port for
      the main NFS transport.  The kernel's mountd client should use an
      unprivileged port in this case as well.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      50a737f8
    • C
      NFS: add "[no]resvport" mount option · d740351b
      Chuck Lever 提交于
      The standard default security setting for NFS is AUTH_SYS.  An NFS
      client connects to NFS servers via a privileged source port and a
      fixed standard destination port (2049).  The client sends raw uid and
      gid numbers to identify users making NFS requests, and the server
      assumes an appropriate authority on the client has vetted these
      values because the source port is privileged.
      
      On Linux, by default in-kernel RPC services use a privileged port in
      the range between 650 and 1023 to avoid using source ports of well-
      known IP services.  Using such a small range limits the number of NFS
      mount points and the number of unique NFS servers to which a client
      can connect concurrently.
      
      An NFS client can use unprivileged source ports to expand the range of
      source port numbers, allowing more concurrent server connections and
      more NFS mount points.  Servers must explicitly allow NFS connections
      from unprivileged ports for this to work.
      
      In the past, bumping the value of the sunrpc.max_resvport sysctl on
      the client would permit the NFS client to use unprivileged ports.
      Bumping this setting also changes the maximum port number used by
      other in-kernel RPC services, some of which still required a port
      number less than 1023.
      
      This is exacerbated by the way source port numbers are chosen by the
      Linux RPC client, which starts at the top of the range and works
      downwards.  It means that bumping the maximum means all RPC services
      requesting a source port will likely get an unprivileged port instead
      of a privileged one.
      
      Changing this setting effects all NFS mount points on a client.  A
      sysadmin could not selectively choose which mount points would use
      non-privileged ports and which could not.
      
      Lastly, this mechanism of expanding the limit on the number of NFS
      mount points was entirely undocumented.
      
      To address the need for the NFS client to use a large range of source
      ports without interfering with the activity of other in-kernel RPC
      services, we introduce a new NFS mount option.  This option explicitly
      tells only the NFS client to use a non-privileged source port when
      communicating with the NFS server for one specific mount point.
      
      This new mount option is called "resvport," like the similar NFS mount
      option on FreeBSD and Mac OS X.  A sister patch for nfs-utils will be
      submitted that documents this new option in nfs(5).
      
      The default setting for this new mount option requires the NFS client
      to use a privileged port, as before.  Explicitly specifying the
      "noresvport" mount option allows the NFS client to use an unprivileged
      source port for this mount point when connecting to the NFS server
      port.
      
      This mount option is supported only for text-based NFS mounts.
      
      [ Sidebar: it is widely known that security mechanisms based on the
        use of privileged source ports are ineffective.  However, the NFS
        client can combine the use of unprivileged ports with the use of
        secure authentication mechanisms, such as Kerberos.  This allows a
        large number of connections and mount points while ensuring a useful
        level of security.
      
        Eventually we may change the default setting for this option
        depending on the security flavor used for the mount.  For example,
        if the mount is using only AUTH_SYS, then the default setting will
        be "resvport;" if the mount is using a strong security flavor such
        as krb5, the default setting will be "noresvport." ]
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      [Trond.Myklebust@netapp.com: Fixed a bug whereby nfs4_init_client()
      was being called with incorrect arguments.]
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      d740351b
    • C
      NFS: introduce nfs_mount_info struct for calling nfs_mount() · c5d120f8
      Chuck Lever 提交于
      Clean up: convert nfs_mount() to take a single data structure argument to make
      it simpler to add more arguments.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      c5d120f8
  7. 31 10月, 2008 1 次提交
  8. 30 10月, 2008 1 次提交
  9. 29 10月, 2008 1 次提交
  10. 27 10月, 2008 1 次提交
  11. 18 10月, 2008 1 次提交
  12. 14 10月, 2008 1 次提交
  13. 11 10月, 2008 1 次提交
    • C
      NFS: fix nfs_parse_ip_address() corner case · 5e2e7721
      Chuck Lever 提交于
      Bruce observed that nfs_parse_ip_address() will successfully parse an
      IPv6 address that looks like this:
      
        "::1%"
      
      A scope delimiter is present, but there is no scope ID following it.
      This is harmless, as it would simply set the scope ID to zero.  However,
      in some cases we would like to flag this as an improperly formed
      address.
      
      We are now also careful to reject addresses where garbage follows the
      address (up to the length of the string), instead of ignoring the
      non-address characters; and where the scope ID is nonsense (not a valid
      device name, but also not numeric).  Before, both of these cases would
      result in a harmless zero scope ID.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      5e2e7721
  14. 08 10月, 2008 4 次提交
  15. 07 10月, 2008 1 次提交
  16. 09 9月, 2008 1 次提交
    • C
      NFS: Restore missing hunk in NFS mount option parser · af904dea
      Chuck Lever 提交于
      Automounter maps can contain mount options valid for other NFS
      implementations but not for Linux.  The Linux automounter uses the
      mount command's "-s" command line option ("s" for "sloppy") so that
      mount requests containing such options are not rejected.
      
      Commit f45663ce attempted to address a
      known regression with text-based NFS mount option parsing.  Unrecognized
      mount options would cause mount requests to fail, even if the "-s"
      option was used on the mount command line.
      
      Unfortunately, this commit was not complete as submitted.  It adds a
      new mount option, "sloppy".  But it is missing a hunk, so it now allows
      NFS mounts with unrecognized mount options, even if the "sloppy" option
      is not present.  This could be a problem if a required critical mount
      option such as "sync" is misspelled, for example, and is considered a
      regression from 2.6.26.
      
      This patch restores the missing hunk.  Now, the default behavior of
      text-based NFS mount options is as before: any unrecognized mount option
      will cause the mount to fail.
      
      Please include this in 2.6.27-rc.
      
      Thanks to Neil Brown for reporting this.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Acked-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      af904dea
  17. 28 7月, 2008 1 次提交
    • M
      nfs_remount oops when rebooting + possible fix · 31c94469
      Marc Zyngier 提交于
      Jeff, Trond,
      
      The commit
      
      48b605f8 (NFS: implement option checking
      when remounting NFS filesystems (resend))
      
      generate an Oops on my platform when rebooting while its root FS on
      an NFS share (NFSv3, TCP) :
      
      Unmounting local filesystems...done.
      Unable to handle kernel NULL pointer dereference at virtual address 00000000
      pgd = c3d00000
      [00000000] *pgd=a3d72031, *pte=00000000, *ppte=00000000
      Internal error: Oops: 17 [#1]
      Modules linked in: cpufreq_powersave cpufreq_ondemand cpufreq_userspace cpufreq_conservative ext3 jbd sd_mod pata_pcmcia libata scsi_mod pcmcia loop firmware_class pxafb cfbcopyarea cfbimgblt cfbfillrect pxa2xx_cs pxa2xx_core pcmcia_core snd_pxa2xx_ac97 snd_ac97_codec ac97_bus snd_pxa2xx_pcm snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd isp116x_hcd soundcore rtc_sa1100 snd_page_alloc pxa25x_udc usbcore rtc_ds1307 rtc_core
      CPU: 0    Not tainted  (2.6.26-03414-g33af79d1-dirty #15)
      PC is at nfs_remount+0x40/0x264
      LR is at do_remount_sb+0x158/0x194
      pc : [<c00bbf54>]    lr : [<c0076c40>]    psr: 60000013
      sp : c2dd1e70  ip : c2dd1e98  fp : c2dd1e94
      r10: 00000040  r9 : c3d17000  r8 : c3c3fc40
      r7 : 00000000  r6 : 00000000  r5 : c3d2b200  r4 : 00000000
      r3 : 00000003  r2 : 00000000  r1 : c2dd1e9c  r0 : c3c3fc00
      Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
      Control: 0000397f  Table: a3d00000  DAC: 00000015
      Process mount (pid: 1462, stack limit = 0xc2dd0270)
      Stack: (0xc2dd1e70 to 0xc2dd2000)
      1e60:                                     00000000 c3c3fc00 00000000 00000000
      1e80: c3c3fc40 c3d17000 c2dd1ebc c2dd1e98 c0076c40 c00bbf20 c01c61e4 00000001
      1ea0: c2dd1ebc 00000001 c3c3fc00 c2dd1ef0 c2dd1ee4 c2dd1ec0 c008c6d8 c0076af4
      1ec0: 00000021 00000040 c2dd1ef0 c3d77000 c3eaa000 00000000 c2dd1f6c c2dd1ee8
      1ee0: c008d1bc c008c5f8 00000000 c2dd0000 c3c0c320 c3805b38 c002064c 0001f820
      1f00: 0001f810 00000001 00000001 00000000 c2dd0000 00000000 c2dd1f34 c2dd1f28
      1f20: c005ead8 c005e6f8 c2dd1f44 c2dd1f38 c005eaf8 c005ead0 c2dd1f6c c2dd1f48
      1f40: c008ae3c 00000000 c3d77000 0001f810 c0ed0021 c0020ca8 c2dd0000 00000000
      1f60: c2dd1fa4 c2dd1f70 c008d2d4 c008d0bc 00000000 0001f810 c2dd1f9c c3eaa000
      1f80: c3d17000 00000000 00000000 be8b6aa8 be8b6ad0 00000015 00000000 c2dd1fa8
      1fa0: c0020b00 c008d254 00000000 be8b6aa8 0001f810 0001f820 0001f830 c0ed0021
      1fc0: 00000000 be8b6aa8 be8b6ad0 00000015 00000000 be8b6ad0 0001f810 be8b6aa8
      1fe0: 0001f810 be8b6964 0000aab8 40125124 60000010 0001f810 00000000 00000000
      Backtrace:
      [<c00bbf14>] (nfs_remount+0x0/0x264) from [<c0076c40>] (do_remount_sb+0x158/0x194)
        r9:c3d17000 r8:c3c3fc40 r7:00000000 r6:00000000 r5:c3c3fc00
      r4:00000000
      [<c0076ae8>] (do_remount_sb+0x0/0x194) from [<c008c6d8>] (do_remount+0xec/0x118)
        r6:c2dd1ef0 r5:c3c3fc00 r4:00000001
      [<c008c5ec>] (do_remount+0x0/0x118) from [<c008d1bc>] (do_mount+0x10c/0x198)
      [<c008d0b0>] (do_mount+0x0/0x198) from [<c008d2d4>] (sys_mount+0x8c/0xd4)
      [<c008d248>] (sys_mount+0x0/0xd4) from [<c0020b00>] (ret_fast_syscall+0x0/0x2c)
        r7:00000015 r6:be8b6ad0 r5:be8b6aa8 r4:00000000
      Code: 0a000086 ea000006 e3530003 8a000004 (e5923000)
      ---[ end trace 55e1b689cf8c8a6a ]---
      ------------[ cut here ]------------
      WARNING: at kernel/exit.c:966 do_exit+0x3c/0x628()
      Modules linked in: cpufreq_powersave cpufreq_ondemand cpufreq_userspace cpufreq_conservative ext3 jbd sd_mod pata_pcmcia libata scsi_mod pcmcia loop firmware_class pxafb cfbcopyarea cfbimgblt cfbfillrect pxa2xx_cs pxa2xx_core pcmcia_core snd_pxa2xx_ac97 snd_ac97_codec ac97_bus snd_pxa2xx_pcm snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd isp116x_hcd soundcore rtc_sa1100 snd_page_alloc pxa25x_udc usbcore rtc_ds1307 rtc_core
      [<c0025168>] (dump_stack+0x0/0x14) from [<c0032154>] (warn_on_slowpath+0x4c/0x68)
      [<c0032108>] (warn_on_slowpath+0x0/0x68) from [<c003531c>] (do_exit+0x3c/0x628)
        r6:0000000b r5:c3c3dc80 r4:c2dd0000
      [<c00352e0>] (do_exit+0x0/0x628) from [<c0025004>] (die+0x2b0/0x30c)
      [<c0024d54>] (die+0x0/0x30c) from [<c00270bc>] (__do_kernel_fault+0x6c/0x80)
      [<c0027050>] (__do_kernel_fault+0x0/0x80) from [<c00272e0>] (do_page_fault+0x210/0x230)
        r7:c3fa7118 r6:c3c3dc80 r5:c3d166a8 r4:00010000
      [<c00270d0>] (do_page_fault+0x0/0x230) from [<c00201ec>] (do_DataAbort+0x3c/0xa0)
      [<c00201b0>] (do_DataAbort+0x0/0xa0) from [<c002064c>] (__dabt_svc+0x4c/0x60)
      Exception stack(0xc2dd1e28 to 0xc2dd1e70)
      1e20:                   c3c3fc00 c2dd1e9c 00000000 00000003 00000000 c3d2b200
      1e40: 00000000 00000000 c3c3fc40 c3d17000 00000040 c2dd1e94 c2dd1e98 c2dd1e70
      1e60: c0076c40 c00bbf54 60000013 ffffffff
        r8:c3c3fc40 r7:00000000 r6:00000000 r5:c2dd1e5c r4:ffffffff
      [<c00bbf14>] (nfs_remount+0x0/0x264) from [<c0076c40>] (do_remount_sb+0x158/0x194)
        r9:c3d17000 r8:c3c3fc40 r7:00000000 r6:00000000 r5:c3c3fc00
      r4:00000000
      [<c0076ae8>] (do_remount_sb+0x0/0x194) from [<c008c6d8>] (do_remount+0xec/0x118)
        r6:c2dd1ef0 r5:c3c3fc00 r4:00000001
      [<c008c5ec>] (do_remount+0x0/0x118) from [<c008d1bc>] (do_mount+0x10c/0x198)
      [<c008d0b0>] (do_mount+0x0/0x198) from [<c008d2d4>] (sys_mount+0x8c/0xd4)
      [<c008d248>] (sys_mount+0x0/0xd4) from [<c0020b00>] (ret_fast_syscall+0x0/0x2c)
        r7:00000015 r6:be8b6ad0 r5:be8b6aa8 r4:00000000
      ---[ end trace 55e1b689cf8c8a6a ]---
      /etc/rc6.d/S60umountroot: line 17:  1462 Segmentation fault      mount $MOUNT_FORCE_OPT -n -o remount,ro -t dummytype dummydev / 2> /dev/null
      
      The new super.c:nfs_remount function doesn't check the validity of the
      options/options4 pointers. Unfortunately, this seems to happend.
      The obvious patch seems to check the pointers, and not to do anything if
      the happend to be NULL.
      
      Tested on an XScale PXA255 system, latest git.
      
      Regards,
      
      	M.
      Signed-off-by: NMarc Zyngier <marc.zyngier@altran.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      31c94469
  18. 16 7月, 2008 1 次提交
  19. 10 7月, 2008 13 次提交