Skip to content
  1. Aug 18, 2021
  2. Aug 15, 2021
    • Greg Kroah-Hartman's avatar
    • Nikolay Borisov's avatar
      btrfs: don't flush from btrfs_delayed_inode_reserve_metadata · 983d6a6b
      Nikolay Borisov authored
      commit 4d14c5cd upstream
      
      Calling btrfs_qgroup_reserve_meta_prealloc from
      btrfs_delayed_inode_reserve_metadata can result in flushing delalloc
      while holding a transaction and delayed node locks. This is deadlock
      prone. In the past multiple commits:
      
       * ae5e070e ("btrfs: qgroup: don't try to wait flushing if we're
      already holding a transaction")
      
       * 6f23277a ("btrfs: qgroup: don't commit transaction when we already
       hold the handle")
      
      Tried to solve various aspects of this but this was always a
      whack-a-mole game. Unfortunately those 2 fixes don't solve a deadlock
      scenario involving btrfs_delayed_node::mutex. Namely, one thread
      can call btrfs_dirty_inode as a result of reading a file and modifying
      its atime:
      
        PID: 6963   TASK: ffff8c7f3f94c000  CPU: 2   COMMAND: "test"
        #0  __schedule at ffffffffa529e07d
        #1  schedule at ffffffffa529e4ff
        #2  schedule_timeout at ffffffffa52a1bdd
        #3  wait_for_completion at ffffffffa529eeea             <-- sleeps with delayed node mutex held
        #4  start_delalloc_inodes at ffffffffc0380db5
        #5  btrfs_start_delalloc_snapshot at ffffffffc0393836
        #6  try_flush_qgroup at ffffffffc03f04b2
        #7  __btrfs_qgroup_reserve_meta at ffffffffc03f5bb6     <-- tries to reserve space and starts delalloc inodes.
        #8  btrfs_delayed_update_inode at ffffffffc03e31aa      <-- acquires delayed node mutex
        #9  btrfs_update_inode at ffffffffc0385ba8
       #10  btrfs_dirty_inode at ffffffffc038627b               <-- TRANSACTIION OPENED
       #11  touch_atime at ffffffffa4cf0000
       #12  generic_file_read_iter at ffffffffa4c1f123
       #13  new_sync_read at ffffffffa4ccdc8a
       #14  vfs_read at ffffffffa4cd0849
       #15  ksys_read at ffffffffa4cd0bd1
       #16  do_syscall_64 at ffffffffa4a052eb
       #17  entry_SYSCALL_64_after_hwframe at ffffffffa540008c
      
      This will cause an asynchronous work to flush the delalloc inodes to
      happen which can try to acquire the same delayed_node mutex:
      
        PID: 455    TASK: ffff8c8085fa4000  CPU: 5   COMMAND: "kworker/u16:30"
        #0  __schedule at ffffffffa529e07d
        #1  schedule at ffffffffa529e4ff
        #2  schedule_preempt_disabled at ffffffffa529e80a
        #3  __mutex_lock at ffffffffa529fdcb                    <-- goes to sleep, never wakes up.
        #4  btrfs_delayed_update_inode at ffffffffc03e3143      <-- tries to acquire the mutex
        #5  btrfs_update_inode at ffffffffc0385ba8              <-- this is the same inode that pid 6963 is holding
        #6  cow_file_range_inline.constprop.78 at ffffffffc0386be7
        #7  cow_file_range at ffffffffc03879c1
        #8  btrfs_run_delalloc_range at ffffffffc038894c
        #9  writepage_delalloc at ffffffffc03a3c8f
       #10  __extent_writepage at ffffffffc03a4c01
       #11  extent_write_cache_pages at ffffffffc03a500b
       #12  extent_writepages at ffffffffc03a6de2
       #13  do_writepages at ffffffffa4c277eb
       #14  __filemap_fdatawrite_range at ffffffffa4c1e5bb
       #15  btrfs_run_delalloc_work at ffffffffc0380987         <-- starts running delayed nodes
       #16  normal_work_helper at ffffffffc03b706c
       #17  process_one_work at ffffffffa4aba4e4
       #18  worker_thread at ffffffffa4aba6fd
       #19  kthread at ffffffffa4ac0a3d
       #20  ret_from_fork at ffffffffa54001ff
      
      To fully address those cases the complete fix is to never issue any
      flushing while holding the transaction or the delayed node lock. This
      patch achieves it by calling qgroup_reserve_meta directly which will
      either succeed without flushing or will fail and return -EDQUOT. In the
      latter case that return value is going to be propagated to
      btrfs_dirty_inode which will fallback to start a new transaction. That's
      fine as the majority of time we expect the inode will have
      BTRFS_DELAYED_NODE_INODE_DIRTY flag set which will result in directly
      copying the in-memory state.
      
      Fixes: c53e9653
      
       ("btrfs: qgroup: try to flush qgroup space when we get -EDQUOT")
      CC: stable@vger.kernel.org # 5.10+
      Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
      Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      983d6a6b
    • Nikolay Borisov's avatar
      ea13f678
    • Qu Wenruo's avatar
      btrfs: qgroup: don't commit transaction when we already hold the handle · 41a9b8f3
      Qu Wenruo authored
      commit 6f23277a upstream
      
      [BUG]
      When running the following script, btrfs will trigger an ASSERT():
      
        #/bin/bash
        mkfs.btrfs -f $dev
        mount $dev $mnt
        xfs_io -f -c "pwrite 0 1G" $mnt/file
        sync
        btrfs quota enable $mnt
        btrfs quota rescan -w $mnt
      
        # Manually set the limit below current usage
        btrfs qgroup limit 512M $mnt $mnt
      
        # Crash happens
        touch $mnt/file
      
      The dmesg looks like this:
      
        assertion failed: refcount_read(&trans->use_count) == 1, in fs/btrfs/transaction.c:2022
        ------------[ cut here ]------------
        kernel BUG at fs/btrfs/ctree.h:3230!
        invalid opcode: 0000 [#1] SMP PTI
        RIP: 0010:assertfail.constprop.0+0x18/0x1a [btrfs]
         btrfs_commit_transaction.cold+0x11/0x5d [btrfs]
         try_flush_qgroup+0x67/0x100 [btrfs]
         __btrfs_qgroup_reserve_meta+0x3a/0x60 [btrfs]
         btrfs_delayed_update_inode+0xaa/0x350 [btrfs]
         btrfs_update_inode+0x9d/0x110 [btrfs]
         btrfs_dirty_inode+0x5d/0xd0 [btrfs]
         touch_atime+0xb5/0x100
         iterate_dir+0xf1/0x1b0
         __x64_sys_getdents64+0x78/0x110
         do_syscall_64+0x33/0x80
         entry_SYSCALL_64_after_hwframe+0x44/0xa9
        RIP: 0033:0x7fb5afe588db
      
      [CAUSE]
      In try_flush_qgroup(), we assume we don't hold a transaction handle at
      all.  This is true for data reservation and mostly true for metadata.
      Since data space reservation always happens before we start a
      transaction, and for most metadata operation we reserve space in
      start_transaction().
      
      But there is an exception, btrfs_delayed_inode_reserve_metadata().
      It holds a transaction handle, while still trying to reserve extra
      metadata space.
      
      When we hit EDQUOT inside btrfs_delayed_inode_reserve_metadata(), we
      will join current transaction and commit, while we still have
      transaction handle from qgroup code.
      
      [FIX]
      Let's check current->journal before we join the transaction.
      
      If current->journal is unset or BTRFS_SEND_TRANS_STUB, it means
      we are not holding a transaction, thus are able to join and then commit
      transaction.
      
      If current->journal is a valid transaction handle, we avoid committing
      transaction and just end it
      
      This is less effective than committing current transaction, as it won't
      free metadata reserved space, but we may still free some data space
      before new data writes.
      
      Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1178634
      Fixes: c53e9653
      
       ("btrfs: qgroup: try to flush qgroup space when we get -EDQUOT")
      Reviewed-by: default avatarFilipe Manana <fdmanana@suse.com>
      Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      41a9b8f3
    • YueHaibing's avatar
      net: xilinx_emaclite: Do not print real IOMEM pointer · 38b8485b
      YueHaibing authored
      commit d0d62baa
      
       upstream.
      
      Printing kernel pointers is discouraged because they might leak kernel
      memory layout.  This fixes smatch warning:
      
      drivers/net/ethernet/xilinx/xilinx_emaclite.c:1191 xemaclite_of_probe() warn:
       argument 4 to %08lX specifier is cast from pointer
      
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarPavel Machek (CIP) <pavel@denx.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      38b8485b
    • Filipe Manana's avatar
      btrfs: fix lockdep splat when enabling and disabling qgroups · 654c19a7
      Filipe Manana authored
      commit a855fbe6
      
       upstream
      
      When running test case btrfs/017 from fstests, lockdep reported the
      following splat:
      
        [ 1297.067385] ======================================================
        [ 1297.067708] WARNING: possible circular locking dependency detected
        [ 1297.068022] 5.10.0-rc4-btrfs-next-73 #1 Not tainted
        [ 1297.068322] ------------------------------------------------------
        [ 1297.068629] btrfs/189080 is trying to acquire lock:
        [ 1297.068929] ffff9f2725731690 (sb_internal#2){.+.+}-{0:0}, at: btrfs_quota_enable+0xaf/0xa70 [btrfs]
        [ 1297.069274]
      		 but task is already holding lock:
        [ 1297.069868] ffff9f2702b61a08 (&fs_info->qgroup_ioctl_lock){+.+.}-{3:3}, at: btrfs_quota_enable+0x3b/0xa70 [btrfs]
        [ 1297.070219]
      		 which lock already depends on the new lock.
      
        [ 1297.071131]
      		 the existing dependency chain (in reverse order) is:
        [ 1297.071721]
      		 -> #1 (&fs_info->qgroup_ioctl_lock){+.+.}-{3:3}:
        [ 1297.072375]        lock_acquire+0xd8/0x490
        [ 1297.072710]        __mutex_lock+0xa3/0xb30
        [ 1297.073061]        btrfs_qgroup_inherit+0x59/0x6a0 [btrfs]
        [ 1297.073421]        create_subvol+0x194/0x990 [btrfs]
        [ 1297.073780]        btrfs_mksubvol+0x3fb/0x4a0 [btrfs]
        [ 1297.074133]        __btrfs_ioctl_snap_create+0x119/0x1a0 [btrfs]
        [ 1297.074498]        btrfs_ioctl_snap_create+0x58/0x80 [btrfs]
        [ 1297.074872]        btrfs_ioctl+0x1a90/0x36f0 [btrfs]
        [ 1297.075245]        __x64_sys_ioctl+0x83/0xb0
        [ 1297.075617]        do_syscall_64+0x33/0x80
        [ 1297.075993]        entry_SYSCALL_64_after_hwframe+0x44/0xa9
        [ 1297.076380]
      		 -> #0 (sb_internal#2){.+.+}-{0:0}:
        [ 1297.077166]        check_prev_add+0x91/0xc60
        [ 1297.077572]        __lock_acquire+0x1740/0x3110
        [ 1297.077984]        lock_acquire+0xd8/0x490
        [ 1297.078411]        start_transaction+0x3c5/0x760 [btrfs]
        [ 1297.078853]        btrfs_quota_enable+0xaf/0xa70 [btrfs]
        [ 1297.079323]        btrfs_ioctl+0x2c60/0x36f0 [btrfs]
        [ 1297.079789]        __x64_sys_ioctl+0x83/0xb0
        [ 1297.080232]        do_syscall_64+0x33/0x80
        [ 1297.080680]        entry_SYSCALL_64_after_hwframe+0x44/0xa9
        [ 1297.081139]
      		 other info that might help us debug this:
      
        [ 1297.082536]  Possible unsafe locking scenario:
      
        [ 1297.083510]        CPU0                    CPU1
        [ 1297.084005]        ----                    ----
        [ 1297.084500]   lock(&fs_info->qgroup_ioctl_lock);
        [ 1297.084994]                                lock(sb_internal#2);
        [ 1297.085485]                                lock(&fs_info->qgroup_ioctl_lock);
        [ 1297.085974]   lock(sb_internal#2);
        [ 1297.086454]
      		  *** DEADLOCK ***
        [ 1297.087880] 3 locks held by btrfs/189080:
        [ 1297.088324]  #0: ffff9f2725731470 (sb_writers#14){.+.+}-{0:0}, at: btrfs_ioctl+0xa73/0x36f0 [btrfs]
        [ 1297.088799]  #1: ffff9f2702b60cc0 (&fs_info->subvol_sem){++++}-{3:3}, at: btrfs_ioctl+0x1f4d/0x36f0 [btrfs]
        [ 1297.089284]  #2: ffff9f2702b61a08 (&fs_info->qgroup_ioctl_lock){+.+.}-{3:3}, at: btrfs_quota_enable+0x3b/0xa70 [btrfs]
        [ 1297.089771]
      		 stack backtrace:
        [ 1297.090662] CPU: 5 PID: 189080 Comm: btrfs Not tainted 5.10.0-rc4-btrfs-next-73 #1
        [ 1297.091132] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
        [ 1297.092123] Call Trace:
        [ 1297.092629]  dump_stack+0x8d/0xb5
        [ 1297.093115]  check_noncircular+0xff/0x110
        [ 1297.093596]  check_prev_add+0x91/0xc60
        [ 1297.094076]  ? kvm_clock_read+0x14/0x30
        [ 1297.094553]  ? kvm_sched_clock_read+0x5/0x10
        [ 1297.095029]  __lock_acquire+0x1740/0x3110
        [ 1297.095510]  lock_acquire+0xd8/0x490
        [ 1297.095993]  ? btrfs_quota_enable+0xaf/0xa70 [btrfs]
        [ 1297.096476]  start_transaction+0x3c5/0x760 [btrfs]
        [ 1297.096962]  ? btrfs_quota_enable+0xaf/0xa70 [btrfs]
        [ 1297.097451]  btrfs_quota_enable+0xaf/0xa70 [btrfs]
        [ 1297.097941]  ? btrfs_ioctl+0x1f4d/0x36f0 [btrfs]
        [ 1297.098429]  btrfs_ioctl+0x2c60/0x36f0 [btrfs]
        [ 1297.098904]  ? do_user_addr_fault+0x20c/0x430
        [ 1297.099382]  ? kvm_clock_read+0x14/0x30
        [ 1297.099854]  ? kvm_sched_clock_read+0x5/0x10
        [ 1297.100328]  ? sched_clock+0x5/0x10
        [ 1297.100801]  ? sched_clock_cpu+0x12/0x180
        [ 1297.101272]  ? __x64_sys_ioctl+0x83/0xb0
        [ 1297.101739]  __x64_sys_ioctl+0x83/0xb0
        [ 1297.102207]  do_syscall_64+0x33/0x80
        [ 1297.102673]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
        [ 1297.103148] RIP: 0033:0x7f773ff65d87
      
      This is because during the quota enable ioctl we lock first the mutex
      qgroup_ioctl_lock and then start a transaction, and starting a transaction
      acquires a fs freeze semaphore (at the VFS level). However, every other
      code path, except for the quota disable ioctl path, we do the opposite:
      we start a transaction and then lock the mutex.
      
      So fix this by making the quota enable and disable paths to start the
      transaction without having the mutex locked, and then, after starting the
      transaction, lock the mutex and check if some other task already enabled
      or disabled the quotas, bailing with success if that was the case.
      
      Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
      
       Conflicts:
      	fs/btrfs/qgroup.c
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      654c19a7
    • Qu Wenruo's avatar
      btrfs: qgroup: remove ASYNC_COMMIT mechanism in favor of reserve retry-after-EDQUOT · c55442cd
      Qu Wenruo authored
      commit adca4d94 upstream
      
      commit a514d638
      
       ("btrfs: qgroup: Commit transaction in advance to
      reduce early EDQUOT") tries to reduce the early EDQUOT problems by
      checking the qgroup free against threshold and tries to wake up commit
      kthread to free some space.
      
      The problem of that mechanism is, it can only free qgroup per-trans
      metadata space, can't do anything to data, nor prealloc qgroup space.
      
      Now since we have the ability to flush qgroup space, and implemented
      retry-after-EDQUOT behavior, such mechanism can be completely replaced.
      
      So this patch will cleanup such mechanism in favor of
      retry-after-EDQUOT.
      
      Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
      Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c55442cd
    • Qu Wenruo's avatar
      btrfs: transaction: Cleanup unused TRANS_STATE_BLOCKED · fdaf6a32
      Qu Wenruo authored
      commit 3296bf56 upstream
      
      The state was introduced in commit 4a9d8bde ("Btrfs: make the state
      of the transaction more readable"), then in commit 302167c5
      
      
      ("btrfs: don't end the transaction for delayed refs in throttle") the
      state is completely removed.
      
      So we can just clean up the state since it's only compared but never
      set.
      
      Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fdaf6a32
    • Qu Wenruo's avatar
      btrfs: qgroup: try to flush qgroup space when we get -EDQUOT · 36af2de5
      Qu Wenruo authored
      commit c53e9653 upstream
      
      [PROBLEM]
      There are known problem related to how btrfs handles qgroup reserved
      space.  One of the most obvious case is the the test case btrfs/153,
      which do fallocate, then write into the preallocated range.
      
      #  btrfs/153 1s ... - output mismatch (see xfstests-dev/results//btrfs/153.out.bad)
      #      --- tests/btrfs/153.out     2019-10-22 15:18:14.068965341 +0800
      #      +++ xfstests-dev/results//btrfs/153.out.bad      2020-07-01 20:24:40.730000089 +0800
      #      @@ -1,2 +1,5 @@
      #       QA output created by 153
      #      +pwrite: Disk quota exceeded
      #      +/mnt/scratch/testfile2: Disk quota exceeded
      #      +/mnt/scratch/testfile2: Disk quota exceeded
      #       Silence is golden
      #      ...
      #      (Run 'diff -u xfstests-dev/tests/btrfs/153.out xfstests-dev/results//btrfs/153.out.bad'  to see the entire diff)
      
      [CAUSE]
      Since commit c6887cd1 ("Btrfs: don't do nocow check unless we have to"),
      we always reserve space no matter if it's COW or not.
      
      Such behavior change is mostly for performance, and reverting it is not
      a good idea anyway.
      
      For preallcoated extent, we reserve qgroup data space for it already,
      and since we also reserve data space for qgroup at buffered write time,
      it needs twice the space for us to write into preallocated space.
      
      This leads to the -EDQUOT in buffered write routine.
      
      And we can't follow the same solution, unlike data/meta space check,
      qgroup reserved space is shared between data/metadata.
      The EDQUOT can happen at the metadata reservation, so doing NODATACOW
      check after qgroup reservation failure is not a solution.
      
      [FIX]
      To solve the problem, we don't return -EDQUOT directly, but every time
      we got a -EDQUOT, we try to flush qgroup space:
      
      - Flush all inodes of the root
        NODATACOW writes will free the qgroup reserved at run_dealloc_range().
        However we don't have the infrastructure to only flush NODATACOW
        inodes, here we flush all inodes anyway.
      
      - Wait for ordered extents
        This would convert the preallocated metadata space into per-trans
        metadata, which can be freed in later transaction commit.
      
      - Commit transaction
        This will free all per-trans metadata space.
      
      Also we don't want to trigger flush multiple times, so here we introduce
      a per-root wait list and a new root status, to ensure only one thread
      starts the flushing.
      
      Fixes: c6887cd1
      
       ("Btrfs: don't do nocow check unless we have to")
      Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
      Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      36af2de5
    • Qu Wenruo's avatar
      btrfs: qgroup: allow to unreserve range without releasing other ranges · 5c79287c
      Qu Wenruo authored
      commit 263da812
      
       upstream
      
      [PROBLEM]
      Before this patch, when btrfs_qgroup_reserve_data() fails, we free all
      reserved space of the changeset.
      
      For example:
      	ret = btrfs_qgroup_reserve_data(inode, changeset, 0, SZ_1M);
      	ret = btrfs_qgroup_reserve_data(inode, changeset, SZ_1M, SZ_1M);
      	ret = btrfs_qgroup_reserve_data(inode, changeset, SZ_2M, SZ_1M);
      
      If the last btrfs_qgroup_reserve_data() failed, it will release the
      entire [0, 3M) range.
      
      This behavior is kind of OK for now, as when we hit -EDQUOT, we normally
      go error handling and need to release all reserved ranges anyway.
      
      But this also means the following call is not possible:
      
      	ret = btrfs_qgroup_reserve_data();
      	if (ret == -EDQUOT) {
      		/* Do something to free some qgroup space */
      		ret = btrfs_qgroup_reserve_data();
      	}
      
      As if the first btrfs_qgroup_reserve_data() fails, it will free all
      reserved qgroup space.
      
      [CAUSE]
      This is because we release all reserved ranges when
      btrfs_qgroup_reserve_data() fails.
      
      [FIX]
      This patch will implement a new function, qgroup_unreserve_range(), to
      iterate through the ulist nodes, to find any nodes in the failure range,
      and remove the EXTENT_QGROUP_RESERVED bits from the io_tree, and
      decrease the extent_changeset::bytes_changed, so that we can revert to
      previous state.
      
      This allows later patches to retry btrfs_qgroup_reserve_data() if EDQUOT
      happens.
      
      Suggested-by: default avatarJosef Bacik <josef@toxicpanda.com>
      Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
      Signed-off-by: default avatarQu Wenruo <wqu@suse.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5c79287c
    • Nikolay Borisov's avatar
      btrfs: make btrfs_qgroup_reserve_data take btrfs_inode · b7a722fd
      Nikolay Borisov authored
      commit 7661a3e0
      
       upstream
      
      There's only a single use of vfs_inode in a tracepoint so let's take
      btrfs_inode directly.
      
      Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b7a722fd
    • Nikolay Borisov's avatar
      btrfs: make qgroup_free_reserved_data take btrfs_inode · dfadea40
      Nikolay Borisov authored
      commit df2cfd13
      
       upstream
      
      It only uses btrfs_inode so can just as easily take it as an argument.
      
      Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dfadea40