1. 10 5月, 2019 2 次提交
  2. 08 5月, 2019 29 次提交
  3. 07 5月, 2019 9 次提交
    • D
      afs: Implement YFS ACL setting · f5e45463
      David Howells 提交于
      Implement the setting of YFS ACLs in AFS through the interface of setting
      the afs.yfs.acl extended attribute on the file.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      f5e45463
    • D
      afs: Get YFS ACLs and information through xattrs · ae46578b
      David Howells 提交于
      The YFS/AuriStor variant of AFS provides more capable ACLs and provides
      per-volume ACLs and per-file ACLs as well as per-directory ACLs.  It also
      provides some extra information that can be retrieved through four ACLs:
      
       (1) afs.yfs.acl
      
           The YFS file ACL (not the same format as afs.acl).
      
       (2) afs.yfs.vol_acl
      
           The YFS volume ACL.
      
       (3) afs.yfs.acl_inherited
      
           "1" if a file's ACL is inherited from its parent directory, "0"
           otherwise.
      
       (4) afs.yfs.acl_num_cleaned
      
           The number of of ACEs removed from the ACL by the server because the
           PT entries were removed from the PTS database (ie. the subject is no
           longer known).
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      ae46578b
    • J
      afs: implement acl setting · b10494af
      Joe Gorse 提交于
      Implements the setting of ACLs in AFS by means of setting the
      afs.acl extended attribute on the file.
      Signed-off-by: NJoe Gorse <jhgorse@gmail.com>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      b10494af
    • D
      afs: Get an AFS3 ACL as an xattr · 260f082b
      David Howells 提交于
      Implement an xattr on AFS files called "afs.acl" that retrieves a file's
      ACL.  It returns the raw AFS3 ACL from the result of calling FS.FetchACL,
      leaving any interpretation to userspace.
      
      Note that whilst YFS servers will respond to FS.FetchACL, this will render
      a more-advanced YFS ACL down.  Use "afs.yfs.acl" instead for that.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      260f082b
    • D
      afs: Fix getting the afs.fid xattr · a2f611a3
      David Howells 提交于
      The AFS3 FID is three 32-bit unsigned numbers and is represented as three
      up-to-8-hex-digit numbers separated by colons to the afs.fid xattr.
      However, with the advent of support for YFS, the FID is now a 64-bit volume
      number, a 96-bit vnode/inode number and a 32-bit uniquifier (as before).
      Whilst the sprintf in afs_xattr_get_fid() has been partially updated (it
      currently ignores the upper 32 bits of the 96-bit vnode number), the size
      of the stack-based buffer has not been increased to match, thereby allowing
      stack corruption to occur.
      
      Fix this by increasing the buffer size appropriately and conditionally
      including the upper part of the vnode number if it is non-zero.  The latter
      requires the lower part to be zero-padded if the upper part is non-zero.
      
      Fixes: 3b6492df ("afs: Increase to 64-bit volume ID and 96-bit vnode ID for YFS")
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      a2f611a3
    • D
      afs: Fix the afs.cell and afs.volume xattr handlers · c73aa410
      David Howells 提交于
      Fix the ->get handlers for the afs.cell and afs.volume xattrs to pass the
      source data size to memcpy() rather than target buffer size.
      
      Overcopying the source data occasionally causes the kernel to oops.
      
      Fixes: d3e3b7ea ("afs: Add metadata xattrs")
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      c73aa410
    • M
      afs: Calculate i_blocks based on file size · c0abbb57
      Marc Dionne 提交于
      While it's not possible to give an accurate number for the blocks
      used on the server, populate i_blocks based on the file size so
      that 'du' can give a reasonable estimate.
      
      The value is rounded up to 1K granularity, for consistency with
      what other AFS clients report, and the servers' 1K usage quota
      unit.  Note that the value calculated by 'du' at the root of a
      volume can still be slightly lower than the quota usage on the
      server, as 0-length files are charged 1 quota block, but are
      reported as occupying 0 blocks.  Again, this is consistent with
      other AFS clients.
      Signed-off-by: NMarc Dionne <marc.dionne@auristor.com>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      c0abbb57
    • D
      afs: Log more information for "kAFS: AFS vnode with undefined type\n" · b134d687
      David Howells 提交于
      Log more information when "kAFS: AFS vnode with undefined type\n" is
      displayed due to a vnode record being retrieved from the server that
      appears to have a duff file type (usually 0).  This prints more information
      to try and help pin down the problem.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      b134d687
    • S
      io_uring: use cpu_online() to check p->sq_thread_cpu instead of cpu_possible() · 7889f44d
      Shenghui Wang 提交于
      This issue is found by running liburing/test/io_uring_setup test.
      
      When test run, the testcase "attempt to bind to invalid cpu" would not
      pass with messages like:
         io_uring_setup(1, 0xbfc2f7c8), \
      flags: IORING_SETUP_SQPOLL|IORING_SETUP_SQ_AFF, \
      resv: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000, \
      sq_thread_cpu: 2
         expected -1, got 3
         FAIL
      
      On my system, there is:
         CPU(s) possible : 0-3
         CPU(s) online   : 0-1
         CPU(s) offline  : 2-3
         CPU(s) present  : 0-1
      
      The sq_thread_cpu 2 is offline on my system, so the bind should fail.
      But cpu_possible() will pass the check. We shouldn't be able to bind
      to an offline cpu. Use cpu_online() to do the check.
      
      After the change, the testcase run as expected: EINVAL will be returned
      for cpu offlined.
      Reviewed-by: NJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: NShenghui Wang <shhuiw@foxmail.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      7889f44d