diff options
author | Elena Reshetova <elena.reshetova@intel.com> | 2017-03-03 09:55:16 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-04-18 14:07:23 +0200 |
commit | 6de5f18e7b0da0cdd265eda047a0bc4f48260bcb (patch) | |
tree | bb6b0807f0b91eea719abb636a19bf6b3e141fea /fs/btrfs/delayed-inode.h | |
parent | btrfs: convert btrfs_delayed_ref_node.refs from atomic_t to refcount_t (diff) | |
download | linux-6de5f18e7b0da0cdd265eda047a0bc4f48260bcb.tar.xz linux-6de5f18e7b0da0cdd265eda047a0bc4f48260bcb.zip |
btrfs: convert btrfs_delayed_node.refs from atomic_t to refcount_t
refcount_t type and corresponding API should be
used instead of atomic_t when the variable is used as
a reference counter. This allows to avoid accidental
refcounter overflows that might lead to use-after-free
situations.
Signed-off-by: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Hans Liljestrand <ishkamiel@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David Windsor <dwindsor@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/delayed-inode.h')
-rw-r--r-- | fs/btrfs/delayed-inode.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/delayed-inode.h b/fs/btrfs/delayed-inode.h index 40327cc3b99a..2f494fdde0ac 100644 --- a/fs/btrfs/delayed-inode.h +++ b/fs/btrfs/delayed-inode.h @@ -26,7 +26,7 @@ #include <linux/list.h> #include <linux/wait.h> #include <linux/atomic.h> - +#include <linux/refcount.h> #include "ctree.h" /* types of the delayed item */ @@ -67,7 +67,7 @@ struct btrfs_delayed_node { struct rb_root del_root; struct mutex mutex; struct btrfs_inode_item inode_item; - atomic_t refs; + refcount_t refs; u64 index_cnt; unsigned long flags; int count; |