linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] fs: list init in the critical section
@ 2018-09-10 12:09 swkhack
  2018-09-11  0:23 ` Dave Chinner
  0 siblings, 1 reply; 2+ messages in thread
From: swkhack @ 2018-09-10 12:09 UTC (permalink / raw)
  To: viro; +Cc: linux-fsdevel, linux-kernel, swkhack

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/2] fs: list init in the critical section
  2018-09-10 12:09 [PATCH 2/2] fs: list init in the critical section swkhack
@ 2018-09-11  0:23 ` Dave Chinner
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Chinner @ 2018-09-11  0:23 UTC (permalink / raw)
  To: swkhack; +Cc: viro, linux-fsdevel, linux-kernel

On Mon, Sep 10, 2018 at 05:09:52AM -0700, swkhack wrote:
> the i_state init in the critical section,so as the list init should in it.

Why? What bug does this fix?

-Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-11  5:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-10 12:09 [PATCH 2/2] fs: list init in the critical section swkhack
2018-09-11  0:23 ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).