1. 28 6月, 2021 2 次提交
  2. 02 6月, 2021 1 次提交
  3. 31 5月, 2021 1 次提交
  4. 21 5月, 2021 1 次提交
  5. 20 5月, 2021 5 次提交
  6. 06 5月, 2021 1 次提交
  7. 21 4月, 2021 1 次提交
  8. 12 4月, 2021 1 次提交
  9. 10 4月, 2021 1 次提交
  10. 09 4月, 2021 1 次提交
  11. 08 4月, 2021 2 次提交
    • A
      gfs2: Make gfs2_setattr_simple static · a4122a95
      Andreas Gruenbacher 提交于
      This function is only used in inode.c.
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      a4122a95
    • B
      gfs2: Add new sysfs file for gfs2 status · 9f9eb5a5
      Bob Peterson 提交于
      This patch adds a new file: /sys/fs/gfs2/*/status which will report
      the status of the file system. Catting this file dumps the current
      status of the file system according to various superblock variables.
      For example:
      
      Journal Checked:          1
      Journal Live:             1
      Journal ID:               0
      Spectator:                0
      Withdrawn:                0
      No barriers:              0
      No recovery:              0
      Demote:                   0
      No Journal ID:            1
      Mounted RO:               0
      RO Recovery:              0
      Skip DLM Unlock:          0
      Force AIL Flush:          0
      FS Frozen:                0
      Withdrawing:              0
      Withdraw In Prog:         0
      Remote Withdraw:          0
      Withdraw Recovery:        0
      sd_log_error:             0
      sd_log_flush_lock:        0
      sd_log_num_revoke:        0
      sd_log_in_flight:         0
      sd_log_blks_needed:       0
      sd_log_blks_free:         32768
      sd_log_flush_head:        0
      sd_log_flush_tail:        5384
      sd_log_blks_reserved:     0
      sd_log_revokes_available: 503
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      9f9eb5a5
  12. 04 4月, 2021 9 次提交
  13. 26 3月, 2021 1 次提交
    • B
      gfs2: report "already frozen/thawed" errors · ff132c5f
      Bob Peterson 提交于
      Before this patch, gfs2's freeze function failed to report an error
      when the target file system was already frozen as it should (and as
      generic vfs function freeze_super does. Similarly, gfs2's thaw function
      failed to report an error when trying to thaw a file system that is not
      frozen, as vfs function thaw_super does. The errors were checked, but
      it always returned a 0 return code.
      
      This patch adds the missing error return codes to gfs2 freeze and thaw.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      ff132c5f
  14. 15 3月, 2021 1 次提交
    • A
      gfs2: Flag a withdraw if init_threads() fails · 62dd0f98
      Andrew Price 提交于
      Interrupting mount with ^C quickly enough can cause the kthread_run()
      calls in gfs2's init_threads() to fail and the error path leads to a
      deadlock on the s_umount rwsem. The abridged chain of events is:
      
        [mount path]
        get_tree_bdev()
          sget_fc()
            alloc_super()
              down_write_nested(&s->s_umount, SINGLE_DEPTH_NESTING); [acquired]
          gfs2_fill_super()
            gfs2_make_fs_rw()
              init_threads()
                kthread_run()
                  ( Interrupted )
            [Error path]
            gfs2_gl_hash_clear()
              flush_workqueue(glock_workqueue)
                wait_for_completion()
      
        [workqueue context]
        glock_work_func()
          run_queue()
            do_xmote()
              freeze_go_sync()
                freeze_super()
                  down_write(&sb->s_umount) [deadlock]
      
      In freeze_go_sync() there is a gfs2_withdrawn() check that we can use to
      make sure freeze_super() is not called in the error path, so add a
      gfs2_withdraw_delayed() call when init_threads() fails.
      
      Ref: https://bugzilla.kernel.org/show_bug.cgi?id=212231Reported-by: NAlexander Aring <aahringo@redhat.com>
      Signed-off-by: NAndrew Price <anprice@redhat.com>
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      62dd0f98
  15. 13 3月, 2021 1 次提交
    • A
      gfs2: be careful with inode refresh · 4a378d8a
      Al Viro 提交于
      1) gfs2_dinode_in() should *not* touch ->i_rdev on live inodes; even
      "zero and immediately reread the same value from dinode" is broken -
      have it overlap with ->release() of char device and you can get all
      kinds of bogus behaviour.
      
      2) mismatch on inode type on live inodes should be treated as fs
      corruption rather than blindly setting ->i_mode.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      4a378d8a
  16. 12 3月, 2021 2 次提交
    • B
      gfs2: bypass log flush if the journal is not live · 0efc4976
      Bob Peterson 提交于
      Patch fe3e3976 ("gfs2: Rework the log space allocation logic")
      changed gfs2_log_flush to reserve a set of journal blocks in case no
      transaction is active.  However, gfs2_log_flush also gets called in
      cases where we don't have an active journal, for example, for spectator
      mounts.  In that case, trying to reserve blocks would sleep forever, but
      we want gfs2_log_flush to be a no-op instead.
      
      Fixes: fe3e3976 ("gfs2: Rework the log space allocation logic")
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      0efc4976
    • B
      gfs2: bypass signal_our_withdraw if no journal · d5bf630f
      Bob Peterson 提交于
      Before this patch, function signal_our_withdraw referenced the journal
      inode immediately. But corrupt file systems may have some invalid
      journals, in which case our attempt to read it in will withdraw and the
      resulting signal_our_withdraw would dereference the NULL value.
      
      This patch adds a check to signal_our_withdraw so that if the journal
      has not yet been initialized, it simply returns and does the old-style
      withdraw.
      
      Thanks, Andy Price, for his analysis.
      
      Reported-by: syzbot+50a8a9cf8127f2c6f5df@syzkaller.appspotmail.com
      Fixes: 601ef0d5 ("gfs2: Force withdraw to replay journals and wait for it to finish")
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      d5bf630f
  17. 11 3月, 2021 1 次提交
  18. 08 3月, 2021 2 次提交
  19. 24 2月, 2021 1 次提交
  20. 23 2月, 2021 4 次提交
    • A
      whack-a-mole: don't open-code iminor/imajor · 6f24784f
      Al Viro 提交于
      several instances creeped back into the tree...
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6f24784f
    • A
      gfs2: Per-revoke accounting in transactions · 2129b428
      Andreas Gruenbacher 提交于
      In the log, revokes are stored as a revoke descriptor (struct
      gfs2_log_descriptor), followed by zero or more additional revoke blocks
      (struct gfs2_meta_header).  On filesystems with a blocksize of 4k, the
      revoke descriptor contains up to 503 revokes, and the metadata blocks
      contain up to 509 revokes each.  We've so far been reserving space for
      revokes in transactions in block granularity, so a lot more space than
      necessary was being allocated and then released again.
      
      This patch switches to assigning revokes to transactions individually
      instead.  Initially, space for the revoke descriptor is reserved and
      handed out to transactions.  When more revokes than that are reserved,
      additional revoke blocks are added.  When the log is flushed, the space
      for the additional revoke blocks is released, but we keep the space for
      the revoke descriptor block allocated.
      
      Transactions may still reserve more revokes than they will actually need
      in the end, but now we won't overshoot the target as much, and by only
      returning the space for excess revokes at log flush time, we further
      reduce the amount of contention between processes.
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      2129b428
    • A
      gfs2: Rework the log space allocation logic · fe3e3976
      Andreas Gruenbacher 提交于
      The current log space allocation logic is hard to understand or extend.
      The principle it that when the log is flushed, we may or may not have a
      transaction active that has space allocated in the log.  To deal with
      that, we set aside a magical number of blocks to be used in case we
      don't have an active transaction.  It isn't clear that the pool will
      always be big enough.  In addition, we can't return unused log space at
      the end of a transaction, so the number of blocks allocated must exactly
      match the number of blocks used.
      
      Simplify this as follows:
       * When transactions are allocated or merged, always reserve enough
         blocks to flush the transaction (err on the safe side).
       * In gfs2_log_flush, return any allocated blocks that haven't been used.
       * Maintain a pool of spare blocks big enough to do one log flush, as
         before.
       * In gfs2_log_flush, when we have no active transaction, allocate a
         suitable number of blocks.  For that, use the spare pool when
         called from logd, and leave the pool alone otherwise.  This means
         that when the log is almost full, logd will still be able to do one
         more log flush, which will result in more log space becoming
         available.
      
      This will make the log space allocator code easier to work with in
      the future.
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      fe3e3976
    • A
      gfs2: Minor calc_reserved cleanup · 71b219f4
      Andreas Gruenbacher 提交于
      No functional change.
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      71b219f4
  21. 18 2月, 2021 1 次提交