1. 15 Jun, 2018 6 commits
    • David Howells's avatar
      afs: Optimise callback breaking by not repeating volume lookup · 47ea0f2e
      David Howells authored
      At the moment, afs_break_callbacks calls afs_break_one_callback() for each
      separate FID it was given, and the latter looks up the volume individually
      for each one.
      
      However, this is inefficient if two or more FIDs have the same vid as we
      could reuse the volume.  This is complicated by cell aliasing whereby we
      may have multiple cells sharing a volume and can therefore have multiple
      callback interests for any particular volume ID.
      
      At the moment afs_break_one_callback() scans the entire list of volumes
      we're getting from a server and breaks the appropriate callback in every
      matching volume, regardless of cell.  This scan is done for every FID.
      
      Optimise callback breaking by the following means:
      
       (1) Sort the FID list by vid so that all FIDs belonging to the same volume
           are clumped together.
      
           This is done through the use of an indirection table as we cannot do
           an insertion sort on the afs_callback_break array as we decode FIDs
           into it as we subsequently also have to decode callback info into it
           that corresponds by array index only.
      
           We also don't really want to bubblesort afterwards if we can avoid it.
      
       (2) Sort the server->cb_interests array by vid so that all the matching
           volumes are grouped together.  This permits the scan to stop after
           finding a record that has a higher vid.
      
       (3) When breaking FIDs, we try to keep server->cb_break_lock as long as
           possible, caching the start point in the array for that volume group
           as long as possible.
      
           It might make sense to add another layer in that list and have a
           refcounted volume ID anchor that has the matching interests attached
           to it rather than being in the list.  This would allow the lock to be
           dropped without losing the cursor.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      47ea0f2e
    • David Howells's avatar
      afs: Display manually added cells in dynamic root mount · 0da0b7fd
      David Howells authored
      Alter the dynroot mount so that cells created by manipulation of
      /proc/fs/afs/cells and /proc/fs/afs/rootcell and by specification of a root
      cell as a module parameter will cause directories for those cells to be
      created in the dynamic root superblock for the network namespace[*].
      
      To this end:
      
       (1) Only one dynamic root superblock is now created per network namespace
           and this is shared between all attempts to mount it.  This makes it
           easier to find the superblock to modify.
      
       (2) When a dynamic root superblock is created, the list of cells is walked
           and directories created for each cell already defined.
      
       (3) When a new cell is added, if a dynamic root superblock exists, a
           directory is created for it.
      
       (4) When a cell is destroyed, the directory is removed.
      
       (5) These directories are created by calling lookup_one_len() on the root
           dir which automatically creates them if they don't exist.
      
      [*] Inasmuch as network namespaces are currently supported here.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      0da0b7fd
    • David Howells's avatar
      afs: Enable IPv6 DNS lookups · c88d5a7f
      David Howells authored
      Remove the restriction on DNS lookup upcalls that prevents ipv6 addresses
      from being looked up.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      c88d5a7f
    • David Howells's avatar
      afs: Show all of a server's addresses in /proc/fs/afs/servers · 0aac4bce
      David Howells authored
      Show all of a server's addresses in /proc/fs/afs/servers, placing the
      second plus addresses on padded lines of their own.  The current address is
      marked with a star.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      0aac4bce
    • David Howells's avatar
      afs: Handle CONFIG_PROC_FS=n · b6cfbeca
      David Howells authored
      The AFS filesystem depends at the moment on /proc for configuration and
      also presents information that way - however, this causes a compilation
      failure if procfs is disabled.
      
      Fix it so that the procfs bits aren't compiled in if procfs is disabled.
      
      This means that you can't configure the AFS filesystem directly, but it is
      still usable provided that an up-to-date keyutils is installed to look up
      cells by SRV or AFSDB DNS records.
      Reported-by: default avatarAl Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      b6cfbeca
    • David Howells's avatar
      proc: Make inline name size calculation automatic · 24074a35
      David Howells authored
      Make calculation of the size of the inline name in struct proc_dir_entry
      automatic, rather than having to manually encode the numbers and failing to
      allow for lockdep.
      
      Require a minimum inline name size of 33+1 to allow for names that look
      like two hex numbers with a dash between.
      Reported-by: default avatarAl Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      24074a35
  2. 02 Jun, 2018 1 commit
  3. 23 May, 2018 3 commits
    • David Howells's avatar
      afs: Implement network namespacing · 5b86d4ff
      David Howells authored
      Implement network namespacing within AFS, but don't yet let mounts occur
      outside the init namespace.  An additional patch will be required propagate
      the network namespace across automounts.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      5b86d4ff
    • David Howells's avatar
      afs: Mark afs_net::ws_cell as __rcu and set using rcu functions · 1588def9
      David Howells authored
      The afs_net::ws_cell member is sometimes used under RCU conditions from
      within an seq-readlock.  It isn't, however, marked __rcu and it isn't set
      using the proper RCU barrier-imposing functions.
      
      Fix this by annotating it with __rcu and using appropriate barriers to
      make sure accesses are correctly ordered.
      
      Without this, the code can produce the following warning:
      
      >> fs/afs/proc.c:151:24: sparse: incompatible types in comparison expression (different address spaces)
      
      Fixes: f044c884 ("afs: Lay the groundwork for supporting network namespaces")
      Reported-by: default avatarkbuild test robot <lkp@intel.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      1588def9
    • David Howells's avatar
      afs: Fix a Sparse warning in xdr_decode_AFSFetchStatus() · c875c76a
      David Howells authored
      Sparse doesn't appear able to handle the conditionally-taken locks in
      xdr_decode_AFSFetchStatus(), even though the lock and unlock are both
      contingent on the same unvarying function argument.
      
      Deal with this by interpolating a wrapper function that takes the lock if
      needed and calls xdr_decode_AFSFetchStatus() on two separate branches, one
      with the lock held and one without.
      
      This allows Sparse to work out the locking.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      c875c76a
  4. 18 May, 2018 5 commits
  5. 17 May, 2018 1 commit
  6. 16 May, 2018 24 commits