1. 02 9月, 2015 1 次提交
  2. 01 9月, 2015 3 次提交
  3. 13 8月, 2015 1 次提交
  4. 11 8月, 2015 12 次提交
  5. 01 8月, 2015 1 次提交
    • J
      nfsd: do nfs4_check_fh in nfs4_check_file instead of nfs4_check_olstateid · 8fcd461d
      Jeff Layton 提交于
      Currently, preprocess_stateid_op calls nfs4_check_olstateid which
      verifies that the open stateid corresponds to the current filehandle in the
      call by calling nfs4_check_fh.
      
      If the stateid is a NFS4_DELEG_STID however, then no such check is done.
      This could cause incorrect enforcement of permissions, because the
      nfsd_permission() call in nfs4_check_file uses current the current
      filehandle, but any subsequent IO operation will use the file descriptor
      in the stateid.
      
      Move the call to nfs4_check_fh into nfs4_check_file instead so that it
      can be done for all stateid types.
      Signed-off-by: NJeff Layton <jeff.layton@primarydata.com>
      Cc: stable@vger.kernel.org
      [bfields: moved fh check to avoid NULL deref in special stateid case]
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      8fcd461d
  6. 23 6月, 2015 1 次提交
    • C
      nfsd: take struct file setup fully into nfs4_preprocess_stateid_op · af90f707
      Christoph Hellwig 提交于
      This patch changes nfs4_preprocess_stateid_op so it always returns
      a valid struct file if it has been asked for that.  For that we
      now allocate a temporary struct file for special stateids, and check
      permissions if we got the file structure from the stateid.  This
      ensures that all callers will get their handling of special stateids
      right, and avoids code duplication.
      
      There is a little wart in here because the read code needs to know
      if we allocated a file structure so that it can copy around the
      read-ahead parameters.  In the long run we should probably aim to
      cache full file structures used with special stateids instead.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      af90f707
  7. 20 6月, 2015 1 次提交
  8. 29 5月, 2015 1 次提交
    • A
      nfsd: work around a gcc-5.1 warning · 6ac75368
      Arnd Bergmann 提交于
      gcc-5.0 warns about a potential uninitialized variable use in nfsd:
      
      fs/nfsd/nfs4state.c: In function 'nfsd4_process_open2':
      fs/nfsd/nfs4state.c:3781:3: warning: 'old_deny_bmap' may be used uninitialized in this function [-Wmaybe-uninitialized]
         reset_union_bmap_deny(old_deny_bmap, stp);
         ^
      fs/nfsd/nfs4state.c:3760:16: note: 'old_deny_bmap' was declared here
        unsigned char old_deny_bmap;
                      ^
      
      This is a false positive, the code path that is warned about cannot
      actually be reached.
      
      This adds an initialization for the variable to make the warning go
      away.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      6ac75368
  9. 05 5月, 2015 4 次提交
  10. 22 4月, 2015 1 次提交
  11. 16 4月, 2015 1 次提交
  12. 03 4月, 2015 1 次提交
    • J
      locks: change lm_get_owner and lm_put_owner prototypes · cae80b30
      Jeff Layton 提交于
      The current prototypes for these operations are somewhat awkward as they
      deal with fl_owners but take struct file_lock arguments. In the future,
      we'll want to be able to take references without necessarily dealing
      with a struct file_lock.
      
      Change them to take fl_owner_t arguments instead and have the callers
      deal with assigning the values to the file_lock structs.
      Signed-off-by: NJeff Layton <jlayton@primarydata.com>
      cae80b30
  13. 01 4月, 2015 2 次提交
  14. 26 3月, 2015 2 次提交
  15. 27 2月, 2015 1 次提交
  16. 03 2月, 2015 7 次提交
    • C
      nfsd: implement pNFS layout recalls · c5c707f9
      Christoph Hellwig 提交于
      Add support to issue layout recalls to clients.  For now we only support
      full-file recalls to get a simple and stable implementation.  This allows
      to embedd a nfsd4_callback structure in the layout_state and thus avoid
      any memory allocations under spinlocks during a recall.  For normal
      use cases that do not intent to share a single file between multiple
      clients this implementation is fully sufficient.
      
      To ensure layouts are recalled on local filesystem access each layout
      state registers a new FL_LAYOUT lease with the kernel file locking code,
      which filesystems that support pNFS exports that require recalls need
      to break on conflicting access patterns.
      
      The XDR code is based on the old pNFS server implementation by
      Andy Adamson, Benny Halevy, Boaz Harrosh, Dean Hildebrand, Fred Isaman,
      Marc Eshel, Mike Sager and Ricardo Labiaga.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      c5c707f9
    • C
      nfsd: implement pNFS operations · 9cf514cc
      Christoph Hellwig 提交于
      Add support for the GETDEVICEINFO, LAYOUTGET, LAYOUTCOMMIT and
      LAYOUTRETURN NFSv4.1 operations, as well as backing code to manage
      outstanding layouts and devices.
      
      Layout management is very straight forward, with a nfs4_layout_stateid
      structure that extends nfs4_stid to manage layout stateids as the
      top-level structure.  It is linked into the nfs4_file and nfs4_client
      structures like the other stateids, and contains a linked list of
      layouts that hang of the stateid.  The actual layout operations are
      implemented in layout drivers that are not part of this commit, but
      will be added later.
      
      The worst part of this commit is the management of the pNFS device IDs,
      which suffers from a specification that is not sanely implementable due
      to the fact that the device-IDs are global and not bound to an export,
      and have a small enough size so that we can't store the fsid portion of
      a file handle, and must never be reused.  As we still do need perform all
      export authentication and validation checks on a device ID passed to
      GETDEVICEINFO we are caught between a rock and a hard place.  To work
      around this issue we add a new hash that maps from a 64-bit integer to a
      fsid so that we can look up the export to authenticate against it,
      a 32-bit integer as a generation that we can bump when changing the device,
      and a currently unused 32-bit integer that could be used in the future
      to handle more than a single device per export.  Entries in this hash
      table are never deleted as we can't reuse the ids anyway, and would have
      a severe lifetime problem anyway as Linux export structures are temporary
      structures that can go away under load.
      
      Parts of the XDR data, structures and marshaling/unmarshaling code, as
      well as many concepts are derived from the old pNFS server implementation
      from Andy Adamson, Benny Halevy, Dean Hildebrand, Marc Eshel, Fred Isaman,
      Mike Sager, Ricardo Labiaga and many others.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      9cf514cc
    • C
      4d227fca
    • C
      e6ba76e1
    • C
    • C
      nfsd: move nfsd_fh_match to nfsfh.h · 4d94c2ef
      Christoph Hellwig 提交于
      The pnfs code will need it too.  Also remove the nfsd_ prefix to match the
      other filehandle helpers in that file.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      4d94c2ef
    • C
      fs: track fl_owner for leases · 2ab99ee1
      Christoph Hellwig 提交于
      Just like for other lock types we should allow different owners to have
      a read lease on a file.  Currently this can't happen, but with the addition
      of pNFS layout leases we'll need this feature.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      2ab99ee1