summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/delayed-inode.h
diff options
context:
space:
mode:
authorElena Reshetova <elena.reshetova@intel.com>2017-03-03 10:55:17 +0200
committerDavid Sterba <dsterba@suse.com>2017-04-18 14:07:23 +0200
commit089e77e10d7e44a007101cf7323dc7bda66172f4 (patch)
tree62bdc5bd9de9681adbba7a9f915bae4b39d67547 /fs/btrfs/delayed-inode.h
parent6de5f18e7b0da0cdd265eda047a0bc4f48260bcb (diff)
downloadlinux-089e77e10d7e44a007101cf7323dc7bda66172f4.tar.gz
linux-089e77e10d7e44a007101cf7323dc7bda66172f4.tar.bz2
linux-089e77e10d7e44a007101cf7323dc7bda66172f4.zip
btrfs: convert btrfs_delayed_item.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.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/delayed-inode.h b/fs/btrfs/delayed-inode.h
index 2f494fdde0ac..c4189d495934 100644
--- a/fs/btrfs/delayed-inode.h
+++ b/fs/btrfs/delayed-inode.h
@@ -80,7 +80,7 @@ struct btrfs_delayed_item {
struct list_head readdir_list; /* used for readdir items */
u64 bytes_reserved;
struct btrfs_delayed_node *delayed_node;
- atomic_t refs;
+ refcount_t refs;
int ins_or_del;
u32 data_len;
char data[0];