linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Alessio Igor Bogani <abogani@texware.it>
Cc: Jan Kara <jack@suse.cz>, Arnd Bergmann <arnd@arndb.de>,
	Christoph Hellwig <hch@infradead.org>,
	Tim Bird <tim.bird@am.sony.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/4] udf: Replace bkl with a mutex for protect udf_sb_info struct
Date: Sat, 6 Nov 2010 14:16:17 -0400	[thread overview]
Message-ID: <20101106181617.GE13315@infradead.org> (raw)
In-Reply-To: <1289065631-2256-4-git-send-email-abogani@texware.it>

> +		mutex_lock(&sbi->lock);
>  		result = udf_relocate_blocks(inode->i_sb,
>  						old_block, &new_block);
> +		mutex_unlock(&sbi->lock);

Moving the locking inside udf_relocate_blocks would be cleaner.

> @@ -570,7 +569,7 @@ static int udf_remount_fs(struct super_block *sb, int *flags, char *options)
>  	if (!udf_parse_options(options, &uopt, true))
>  		return -EINVAL;
>  
> -	lock_kernel();
> +	mutex_lock(&sbi->lock);

What are you protecting against here?  Concurrent remount calls are
protects against by the VFS.  Is there any reader that takes sbi->lock
to get a consistent view of the various options?  It doesn't seem you
introduce one in this series, so it seems we could do fine without any
locking.

> -		unlock_kernel();
>  		return -ENOMEM;
>  	}
>  
> +	mutex_init(&sbi->lock);
> +	mutex_lock(&sbi->lock);

What are you locking against here?  I can't fine anything that puts the
superblock on a global list in fill_super, and I can't find any code
that would look a superblock up that's not fully set up.  I don't think
synchronization here in fill_super is needed at all.

> +	/* Serialize writer access, replace the old bkl */
> +	struct mutex lock;

Same comment as for the per-inode mutex applies here, too.


  reply	other threads:[~2010-11-06 18:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-06 17:47 [PATCH 1/4] udf: Add missed protection for s_lvid_dirty Alessio Igor Bogani
2010-11-06 17:47 ` [PATCH 2/4] udf: Remove unnecessary bkl usages Alessio Igor Bogani
2010-11-06 18:06   ` Christoph Hellwig
2010-11-06 17:47 ` [PATCH 3/4] udf: Replace bkl with a mutex for protect udf_inode_info struct Alessio Igor Bogani
2010-11-06 18:10   ` Christoph Hellwig
2010-11-06 17:47 ` [PATCH 4/4] udf: Replace bkl with a mutex for protect udf_sb_info struct Alessio Igor Bogani
2010-11-06 18:16   ` Christoph Hellwig [this message]
2010-11-06 18:05 ` [PATCH 1/4] udf: Add missed protection for s_lvid_dirty Christoph Hellwig
2010-11-07 14:14   ` Jan Kara
2010-11-07 14:27     ` Christoph Hellwig
2010-11-07 15:06 ` Jan Kara
2010-11-15 22:46 ` Arnd Bergmann
2010-11-16  0:43   ` Jan Kara
2010-11-16 13:03     ` Alessio Igor Bogani

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=20101106181617.GE13315@infradead.org \
    --to=hch@infradead.org \
    --cc=abogani@texware.it \
    --cc=arnd@arndb.de \
    --cc=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tim.bird@am.sony.com \
    /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).