1. 31 5月, 2019 1 次提交
  2. 30 5月, 2019 1 次提交
  3. 25 5月, 2019 1 次提交
  4. 24 5月, 2019 9 次提交
  5. 22 5月, 2019 2 次提交
    • T
      ext4: don't perform block validity checks on the journal inode · 0a944e8a
      Theodore Ts'o 提交于
      Since the journal inode is already checked when we added it to the
      block validity's system zone, if we check it again, we'll just trigger
      a failure.
      
      This was causing failures like this:
      
      [   53.897001] EXT4-fs error (device sda): ext4_find_extent:909: inode
      #8: comm jbd2/sda-8: pblk 121667583 bad header/extent: invalid extent entries - magic f30a, entries 8, max 340(340), depth 0(0)
      [   53.931430] jbd2_journal_bmap: journal block not found at offset 49 on sda-8
      [   53.938480] Aborting journal on device sda-8.
      
      ... but only if the system was under enough memory pressure that
      logical->physical mapping for the journal inode gets pushed out of the
      extent cache.  (This is why it wasn't noticed earlier.)
      
      Fixes: 345c0dbf ("ext4: protect journal inode's blocks using block_validity")
      Reported-by: NDan Rue <dan.rue@linaro.org>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      Tested-by: NNaresh Kamboju <naresh.kamboju@linaro.org>
      0a944e8a
    • A
      gfs2: Fix sign extension bug in gfs2_update_stats · 5a5ec83d
      Andreas Gruenbacher 提交于
      Commit 4d207133 changed the types of the statistic values in struct
      gfs2_lkstats from s64 to u64.  Because of that, what should be a signed
      value in gfs2_update_stats turned into an unsigned value.  When shifted
      right, we end up with a large positive value instead of a small negative
      value, which results in an incorrect variance estimate.
      
      Fixes: 4d207133 ("gfs2: Make statistics unsigned, suitable for use with do_div()")
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      Cc: stable@vger.kernel.org # v4.4+
      5a5ec83d
  6. 21 5月, 2019 6 次提交
  7. 19 5月, 2019 1 次提交
  8. 18 5月, 2019 2 次提交
  9. 17 5月, 2019 8 次提交
  10. 16 5月, 2019 9 次提交
    • D
      afs: Fix double inc of vnode->cb_break · fd711586
      David Howells 提交于
      When __afs_break_callback() clears the CB_PROMISED flag, it increments
      vnode->cb_break to trigger a future refetch of the status and callback -
      however it also calls afs_clear_permits(), which also increments
      vnode->cb_break.
      
      Fix this by removing the increment from afs_clear_permits().
      
      Whilst we're at it, fix the conditional call to afs_put_permits() as the
      function checks to see if the argument is NULL, so the check is redundant.
      
      Fixes: be080a6f ("afs: Overhaul permit caching");
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      fd711586
    • D
      afs: Fix application of status and callback to be under same lock · a58823ac
      David Howells 提交于
      When applying the status and callback in the response of an operation,
      apply them in the same critical section so that there's no race between
      checking the callback state and checking status-dependent state (such as
      the data version).
      
      Fix this by:
      
       (1) Allocating a joint {status,callback} record (afs_status_cb) before
           calling the RPC function for each vnode for which the RPC reply
           contains a status or a status plus a callback.  A flag is set in the
           record to indicate if a callback was actually received.
      
       (2) These records are passed into the RPC functions to be filled in.  The
           afs_decode_status() and yfs_decode_status() functions are removed and
           the cb_lock is no longer taken.
      
       (3) xdr_decode_AFSFetchStatus() and xdr_decode_YFSFetchStatus() no longer
           update the vnode.
      
       (4) xdr_decode_AFSCallBack() and xdr_decode_YFSCallBack() no longer update
           the vnode.
      
       (5) vnodes, expected data-version numbers and callback break counters
           (cb_break) no longer need to be passed to the reply delivery
           functions.
      
           Note that, for the moment, the file locking functions still need
           access to both the call and the vnode at the same time.
      
       (6) afs_vnode_commit_status() is now given the cb_break value and the
           expected data_version and the task of applying the status and the
           callback to the vnode are now done here.
      
           This is done under a single taking of vnode->cb_lock.
      
       (7) afs_pages_written_back() is now called by afs_store_data() rather than
           by the reply delivery function.
      
           afs_pages_written_back() has been moved to before the call point and
           is now given the first and last page numbers rather than a pointer to
           the call.
      
       (8) The indicator from YFS.RemoveFile2 as to whether the target file
           actually got removed (status.abort_code == VNOVNODE) rather than
           merely dropping a link is now checked in afs_unlink rather than in
           xdr_decode_YFSFetchStatus().
      
      Supplementary fixes:
      
       (*) afs_cache_permit() now gets the caller_access mask from the
           afs_status_cb object rather than picking it out of the vnode's status
           record.  afs_fetch_status() returns caller_access through its argument
           list for this purpose also.
      
       (*) afs_inode_init_from_status() now uses a write lock on cb_lock rather
           than a read lock and now sets the callback inside the same critical
           section.
      
      Fixes: c435ee34 ("afs: Overhaul the callback handling")
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      a58823ac
    • D
      afs: Fix lock-wait/callback-break double locking · c7226e40
      David Howells 提交于
      __afs_break_callback() holds vnode->lock around its call of
      afs_lock_may_be_available() - which also takes that lock.
      
      Fix this by not taking the lock in __afs_break_callback().
      
      Also, there's no point checking the granted_locks and pending_locks queues;
      it's sufficient to check lock_state, so move that check out of
      afs_lock_may_be_available() into __afs_break_callback() to replace the
      queue checks.
      
      Fixes: e8d6c554 ("AFS: implement file locking")
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      c7226e40
    • D
      afs: Always get the reply time · 4571577f
      David Howells 提交于
      Always ask for the reply time from AF_RXRPC as it's used to calculate the
      callback expiry time and lock expiry times, so it's needed by most FS
      operations.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      4571577f
    • D
      afs: Don't invalidate callback if AFS_VNODE_DIR_VALID not set · d9052dda
      David Howells 提交于
      Don't invalidate the callback promise on a directory if the
      AFS_VNODE_DIR_VALID flag is not set (which indicates that the directory
      contents are invalid, due to edit failure, callback break, page reclaim).
      
      The directory will be reloaded next time the directory is accessed, so
      clearing the callback flag at this point may race with a reload of the
      directory and cancel it's recorded callback promise.
      
      Fixes: f3ddee8d ("afs: Fix directory handling")
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      d9052dda
    • D
      afs: Fix order-1 allocation in afs_do_lookup() · 87182759
      David Howells 提交于
      afs_do_lookup() will do an order-1 allocation to allocate status records if
      there are more than 39 vnodes to stat.
      
      Fix this by allocating an array of {status,callback} records for each vnode
      we want to examine using vmalloc() if larger than a page.
      
      This not only gets rid of the order-1 allocation, but makes it easier to
      grow beyond 50 records for YFS servers.  It also allows us to move to
      {status,callback} tuples for other calls too and makes it easier to lock
      across the application of the status and the callback to the vnode.
      
      Fixes: 5cf9dd55 ("afs: Prospectively look up extra files when doing a single lookup")
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      87182759
    • D
      afs: Fix calculation of callback expiry time · 78107055
      David Howells 提交于
      Fix the calculation of the expiry time of a callback promise, as obtained
      from operations like FS.FetchStatus and FS.FetchData.
      
      The time should be based on the timestamp of the first DATA packet in the
      reply and the calculation needs to turn the ktime_t timestamp into a
      time64_t.
      
      Fixes: c435ee34 ("afs: Overhaul the callback handling")
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      78107055
    • D
      afs: Get rid of afs_call::reply[] · ffba718e
      David Howells 提交于
      Replace the afs_call::reply[] array with a bunch of typed members so that
      the compiler can use type-checking on them.  It's also easier for the eye
      to see what's going on.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      ffba718e
    • D
      afs: Make dynamic root population wait uninterruptibly for proc_cells_lock · 3b05e528
      David Howells 提交于
      Make dynamic root population wait uninterruptibly for proc_cells_lock.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      3b05e528