]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: protect exclusive_operation by super_lock
authorDavid Sterba <dsterba@suse.com>
Fri, 14 May 2021 15:42:30 +0000 (17:42 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jun 2021 13:19:06 +0000 (15:19 +0200)
commitaf335e4454c17fff9db48148c41c6736f8c69e05
tree810d274da2a745f835dec62e2cf5bbee33f8ca21
parent597655aa457c00f3af7a81676b4f59e46d5f8abd
btrfs: protect exclusive_operation by super_lock

The exclusive operation is now atomically checked and set using bit
operations. Switch it to protection by spinlock. The super block lock is
not frequently used and adding a new lock seems like an overkill so it
should be safe to reuse it.

The reason to use spinlock is to enhance the locking context so more
checks can be done, eg. allowing the same exclusive operation enter
the exclop section and cancel the running one. This will be used for
resize and device delete.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/ioctl.c