public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Jan Blunck <jblunck@suse.de>
Cc: linux-fsdevel@vger.kernel.org,
	Linux-Kernel Mailinglist <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	jkacur@redhat.com, Thomas Gleixner <tglx@linutronix.de>,
	Christoph Hellwig <hch@infradead.org>,
	Arnd Bergmann <arnd@arndb.de>,
	matthew@wil.cx, Andi Kleen <andi@firstfloor.org>,
	Jan Kara <jack@suse.cz>
Subject: Re: [PATCH 19/20] ext2: Add ext2_sb_info s_lock spinlock
Date: Wed, 18 Nov 2009 21:31:16 +0900	[thread overview]
Message-ID: <87pr7g3tgr.fsf@devron.myhome.or.jp> (raw)
In-Reply-To: <1258536293-7762-20-git-send-email-jblunck@suse.de> (Jan Blunck's message of "Wed, 18 Nov 2009 10:24:52 +0100")

Jan Blunck <jblunck@suse.de> writes:

> +static void ext2_sync_super(struct super_block *sb,
> +			    struct ext2_super_block *es)
>  {
> +	spin_lock(&EXT2_SB(sb)->s_lock);
>  	es->s_free_blocks_count = cpu_to_le32(ext2_count_free_blocks(sb));
>  	es->s_free_inodes_count = cpu_to_le32(ext2_count_free_inodes(sb));
>  	es->s_wtime = cpu_to_le32(get_seconds());
> +	/* unlock before we do IO */
> +	spin_unlock(&EXT2_SB(sb)->s_lock);
>  	mark_buffer_dirty(EXT2_SB(sb)->s_sbh);
>  	sync_dirty_buffer(EXT2_SB(sb)->s_sbh);
>  	sb->s_dirt = 0;

[...]

>  static int ext2_sync_fs(struct super_block *sb, int wait)
>  {
> -	struct ext2_super_block *es = EXT2_SB(sb)->s_es;
> +	struct ext2_sb_info *sbi = EXT2_SB(sb);
> +	struct ext2_super_block *es = sbi->s_es;
>  
>  	lock_kernel();
> +	spin_lock(&sbi->s_lock);
>  	if (es->s_state & cpu_to_le16(EXT2_VALID_FS)) {
>  		ext2_debug("setting valid to 0\n");
>  		es->s_state &= cpu_to_le16(~EXT2_VALID_FS);
> @@ -1137,9 +1159,11 @@ static int ext2_sync_fs(struct super_block *sb, int wait)
>  		es->s_free_inodes_count =
>  			cpu_to_le32(ext2_count_free_inodes(sb));
>  		es->s_mtime = cpu_to_le32(get_seconds());
> +		spin_unlock(&EXT2_SB(sb)->s_lock);
>  		ext2_sync_super(sb, es);
>  	} else {
>  		ext2_commit_super(sb, es);
> +		spin_unlock(&sbi->s_lock);
>  	}
>  	sb->s_dirt = 0;

[...]

> @@ -1237,6 +1264,7 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)
>  		if (!ext2_setup_super (sb, es, 0))
>  			sb->s_flags &= ~MS_RDONLY;
>  	}
> +	spin_unlock(&EXT2_SB(sb)->s_lock);
>  	ext2_sync_super(sb, es);
>  	unlock_kernel();
>  	return 0;

ext2_setup_super() will call ext2_sync_fs(), so ->s_lock seems to be
recursive in here.

Thanks.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

  reply	other threads:[~2009-11-18 12:31 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-18  9:24 [PATCH 00/20] BKL pushdown from do_new_mount() to the filesystems (v3) Jan Blunck
2009-11-18  9:24 ` [PATCH 01/20] JFS: Free sbi memory in error path Jan Blunck
2009-11-18  9:24 ` [PATCH 02/20] AFFS: " Jan Blunck
2009-11-18  9:24 ` [PATCH 04/20] BKL: Remove outdated comment and include Jan Blunck
2009-11-18  9:24 ` [PATCH 05/20] BKL: Remove BKL from Amiga FFS Jan Blunck
2009-11-18  9:24 ` [PATCH 06/20] BKL: Remove BKL from BFS Jan Blunck
2009-11-18  9:24 ` [PATCH 07/20] BKL: Remove BKL from CifsFS Jan Blunck
2009-11-18  9:24 ` [PATCH 08/20] BKL: Remove BKL from ext3 fill_super() Jan Blunck
2009-11-18  9:24 ` [PATCH 09/20] BKL: Remove BKL from ext3_put_super() and ext3_remount() Jan Blunck
2009-11-18  9:24 ` [PATCH 10/20] BKL: Remove BKL from ext4 filesystem Jan Blunck
2009-11-18  9:24 ` [PATCH 11/20] BKL: Remove BKL from exofs Jan Blunck
2009-11-18  9:24 ` [PATCH 12/20] BKL: Remove BKL from HFS Jan Blunck
2009-11-18  9:24 ` [PATCH 13/20] BKL: Remove BKL from HFS+ Jan Blunck
2009-11-18  9:24 ` [PATCH 14/20] BKL: Remove BKL from JFS Jan Blunck
2009-11-18  9:24 ` [PATCH 15/20] BKL: Remove BKL from NILFS2 Jan Blunck
2009-11-18 14:40   ` Ryusuke Konishi
2009-11-18  9:24 ` [PATCH 16/20] BKL: Remove BKL from NTFS Jan Blunck
2009-11-18  9:24 ` [PATCH 17/20] BKL: Remove BKL from cgroup Jan Blunck
2009-11-18 18:24   ` Paul Menage
2009-11-18  9:24 ` [PATCH 18/20] BKL: Remove BKL from do_new_mount() Jan Blunck
2009-11-18  9:24 ` [PATCH 19/20] ext2: Add ext2_sb_info s_lock spinlock Jan Blunck
2009-11-18 12:31   ` OGAWA Hirofumi [this message]
2009-11-18  9:24 ` [PATCH 20/20] BKL: Remove BKL from ext2 filesystem Jan Blunck
     [not found] ` <1258536293-7762-4-git-send-email-jblunck@suse.de>
2009-11-18 10:41   ` [PATCH 03/20] BKL: Explicitly add BKL around get_sb/fill_super Anders Larsen

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=87pr7g3tgr.fsf@devron.myhome.or.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=arnd@arndb.de \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=jblunck@suse.de \
    --cc=jkacur@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=tglx@linutronix.de \
    /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