linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: swkhack <swkhack@gmail.com>
To: viro@zeniv.linux.org.uk
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	swkhack <swkhack@gmail.com>
Subject: [PATCH 2/2] fs: list init in the critical section
Date: Mon, 10 Sep 2018 05:09:52 -0700	[thread overview]
Message-ID: <1536581392-11343-1-git-send-email-swkhack@gmail.com> (raw)

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

             reply	other threads:[~2018-09-10 17:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-10 12:09 swkhack [this message]
2018-09-11  0:23 ` [PATCH 2/2] fs: list init in the critical section Dave Chinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1536581392-11343-1-git-send-email-swkhack@gmail.com \
    --to=swkhack@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).