linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vfs: Remove the unnecessary protect.
@ 2013-04-09  8:06 majianpeng
  2013-04-15 14:42 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: majianpeng @ 2013-04-09  8:06 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-kernel, linux-fsdevel

After allocating a inode,it don't chain in superblock.At this time,it
won't be used by others.So it make no sense to protect there.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
---
fs/inode.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/fs/inode.c b/fs/inode.c
index f5f7c06..1d7b0dd 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -906,9 +906,7 @@ struct inode *new_inode_pseudo(struct super_block *sb)
struct inode *inode = alloc_inode(sb);

if (inode) {
- spin_lock(&inode->i_lock);
inode->i_state = 0;
- spin_unlock(&inode->i_lock);
INIT_LIST_HEAD(&inode->i_sb_list);
}
return inode;
-- 
1.8.2.rc2.4.g7799588

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

* Re: [PATCH] vfs: Remove the unnecessary protect.
  2013-04-09  8:06 [PATCH] vfs: Remove the unnecessary protect majianpeng
@ 2013-04-15 14:42 ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2013-04-15 14:42 UTC (permalink / raw)
  To: majianpeng; +Cc: Al Viro, linux-kernel, linux-fsdevel

On Tue 09-04-13 16:06:39, majianpeng wrote:
> After allocating a inode,it don't chain in superblock.At this time,it
> won't be used by others.So it make no sense to protect there.
  Something (likely your mailer) has mangled whitespace in your patch.
Please submit patches with a program that preserves whitespace (preferred)
or use text/plain attachments.

Also I don't think the argument for removing i_lock locking is as simple.
Without the lock, i_state initialization can be speculatively performed
earlier / later wrt other instructions by the CPU so it's not clear this
cannot cause problems to some of the callers.

								Honza

> Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
> ---
> fs/inode.c | 2 --
> 1 file changed, 2 deletions(-)
> 
> diff --git a/fs/inode.c b/fs/inode.c
> index f5f7c06..1d7b0dd 100644
> --- a/fs/inode.c
> +++ b/fs/inode.c
> @@ -906,9 +906,7 @@ struct inode *new_inode_pseudo(struct super_block *sb)
> struct inode *inode = alloc_inode(sb);
> 
> if (inode) {
> - spin_lock(&inode->i_lock);
> inode->i_state = 0;
> - spin_unlock(&inode->i_lock);
> INIT_LIST_HEAD(&inode->i_sb_list);
> }
> return inode;
> -- 
> 1.8.2.rc2.4.g7799588
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

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

end of thread, other threads:[~2013-04-16 16:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-09  8:06 [PATCH] vfs: Remove the unnecessary protect majianpeng
2013-04-15 14:42 ` Jan Kara

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).