lkml.org 
[lkml]   [2018]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] fs: list init in the critical section
Date
the i_state init in the critical section,so as the list init should in it.

Signed-off-by: swkhack <swkhack@gmail.com>
---
fs/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/inode.c b/fs/inode.c
index 42f6d25..d3e07e4 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -905,8 +905,8 @@ struct inode *new_inode_pseudo(struct super_block *sb)
if (inode) {
spin_lock(&inode->i_lock);
inode->i_state = 0;
- spin_unlock(&inode->i_lock);
INIT_LIST_HEAD(&inode->i_sb_list);
+ spin_unlock(&inode->i_lock);
}
return inode;
}
--
2.7.4
\
 
 \ /
  Last update: 2018-09-10 14:10    [W:0.037 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site