summaryrefslogtreecommitdiff
path: root/fs/ext4/super.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2014-04-21 22:37:55 +0400
committerTheodore Ts'o <tytso@mit.edu>2014-04-21 22:37:55 +0400
commit202ee5df38b33f7ea28286807a0b548b49613194 (patch)
tree5737ca8bd3f24d2af02c269e0be06ee255157fc0 /fs/ext4/super.c
parentf5ccfe1ddbaf9d923a3ebdadcb1e5e32d83e9c28 (diff)
downloadlinux-202ee5df38b33f7ea28286807a0b548b49613194.tar.xz
ext4: add a new spinlock i_raw_lock to protect the ext4's raw inode
To avoid potential data races, use a spinlock which protects the raw (on-disk) inode. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Reviewed-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r--fs/ext4/super.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index c4895c195e00..1f8cb1812723 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -879,6 +879,7 @@ static struct inode *ext4_alloc_inode(struct super_block *sb)
return NULL;
ei->vfs_inode.i_version = 1;
+ spin_lock_init(&ei->i_raw_lock);
INIT_LIST_HEAD(&ei->i_prealloc_list);
spin_lock_init(&ei->i_prealloc_lock);
ext4_es_init_tree(&ei->i_es_tree);