1. 28 11月, 2019 1 次提交
  2. 25 11月, 2019 10 次提交
  3. 15 11月, 2019 1 次提交
  4. 15 10月, 2019 1 次提交
    • D
      rbd: cancel lock_dwork if the wait is interrupted · 25e6be21
      Dongsheng Yang 提交于
      There is a warning message in my test with below steps:
      
        # rbd bench --io-type write --io-size 4K --io-threads 1 --io-pattern rand test &
        # sleep 5
        # pkill -9 rbd
        # rbd map test &
        # sleep 5
        # pkill rbd
      
      The reason is that the rbd_add_acquire_lock() is interruptable,
      that means, when we kill the waiting on ->acquire_wait, the lock_dwork
      could be still running.
      
      1. do_rbd_add()					2. lock_dwork
      rbd_add_acquire_lock()
        - queue_delayed_work()
      						lock_dwork queued
          - wait_for_completion_killable_timeout()  <-- kill happen
      rbd_dev_image_unlock()	<-- UNLOCKED now, nothing to do.
      rbd_dev_device_release()
      rbd_dev_image_release()
        - ...
      						lock successed here
           - cancel_delayed_work_sync(&rbd_dev->lock_dwork)
      
      Then when we reach the rbd_dev_free(), WARN_ON is triggered because
      lock_state is not RBD_LOCK_STATE_UNLOCKED.
      
      To fix it, this commit make sure the lock_dwork was finished before
      calling rbd_dev_image_unlock().
      
      On the other hand, this would not happend in do_rbd_remove(), because
      after rbd mapped, lock_dwork will only be queued for IO request, and
      request will continue unless lock_dwork finished. when we call
      rbd_dev_image_unlock() in do_rbd_remove(), all requests are done.
      That means, lock_state should not be locked again after
      rbd_dev_image_unlock().
      
      [ Cancel lock_dwork in rbd_add_acquire_lock(), only if the wait is
        interrupted. ]
      
      Fixes: 637cd060 ("rbd: new exclusive lock wait/wake code")
      Signed-off-by: NDongsheng Yang <dongsheng.yang@easystack.cn>
      Reviewed-by: NIlya Dryomov <idryomov@gmail.com>
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      25e6be21
  5. 16 9月, 2019 2 次提交
  6. 28 8月, 2019 1 次提交
  7. 08 7月, 2019 18 次提交
  8. 08 5月, 2019 4 次提交
    • I
      rbd: don't assert on writes to snapshots · b91a7bdc
      Ilya Dryomov 提交于
      The check added in commit 721c7fc7 ("block: fail op_is_write()
      requests to read-only partitions") was lifted in commit a32e236e
      ("Partially revert "block: fail op_is_write() requests to read-only
      partitions"").  Basic things like user triggered writes and discards
      are still caught, but internal kernel users can submit anything.  In
      particular, ext4 will attempt to write to the superblock if it detects
      errors in the filesystem, even if the filesystem is mounted read-only
      on a read-only partition.
      
      The assert is overkill regardless.
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      b91a7bdc
    • I
      rbd: client_mutex is never nested · a32e4143
      Ilya Dryomov 提交于
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      a32e4143
    • A
      rbd: convert all rbd_assert(0) to BUG() · 16809372
      Arnd Bergmann 提交于
      rbd_assert(0) has caused different issues depending on
      the compiler version in the past, so it seems better to avoid it
      completely.
      
      Replace the remaining instances.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NIlya Dryomov <idryomov@gmail.com>
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      16809372
    • A
      rbd: avoid clang -Wuninitialized warning · d342a15b
      Arnd Bergmann 提交于
      clang fails to see that rbd_assert(0) ends in an unreachable code
      path and warns about a subsequent use of an uninitialized variable
      when CONFIG_PROFILE_ANNOTATED_BRANCHES is set:
      
      drivers/block/rbd.c:2402:4: error: variable 'ret' is used uninitialized whenever 'if' condition is false
            [-Werror,-Wsometimes-uninitialized]
                              rbd_assert(0);
                              ^~~~~~~~~~~~~
      drivers/block/rbd.c:563:7: note: expanded from macro 'rbd_assert'
                      if (unlikely(!(expr))) {                                \
                          ^~~~~~~~~~~~~~~~~
      include/linux/compiler.h:48:23: note: expanded from macro 'unlikely'
       #  define unlikely(x)   (__branch_check__(x, 0, __builtin_constant_p(x)))
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      drivers/block/rbd.c:2410:6: note: uninitialized use occurs here
              if (ret) {
                  ^~~
      drivers/block/rbd.c:2402:4: note: remove the 'if' if its condition is always true
                              rbd_assert(0);
                              ^
      drivers/block/rbd.c:563:3: note: expanded from macro 'rbd_assert'
                      if (unlikely(!(expr))) {                                \
                      ^
      drivers/block/rbd.c:2376:9: note: initialize the variable 'ret' to silence this warning
              int ret;
                     ^
                      = 0
      1 error generated.
      
      This seems to be a bug in clang, but is easy to work around by using
      an unconditional BUG().
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NIlya Dryomov <idryomov@gmail.com>
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      d342a15b
  9. 20 3月, 2019 1 次提交
  10. 19 3月, 2019 1 次提交