lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 25 May 2009 00:03:38 +0200
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Stephen Rothwell <sfr@...b.auug.org.au>
Cc:	Al Viro <viro@...IV.linux.org.uk>, linux-next@...r.kernel.org,
	linux-kernel@...r.kernel.org, Christoph Hellwig <hch@....de>
Subject: Re: linux-next: manual merge of the vfs tree with the  tree

On Fri, May 22, 2009 at 11:23:26AM +1000, Stephen Rothwell wrote:
> Hi Al,
> 
> Today's linux-next merge of the vfs tree got a conflict in
> fs/reiserfs/super.c between commit
> d38705358bf6f5ab82348d0c6ee8039cea20ce6b ("reiserfs: kill-the-BKL") from
> the reiserfs-bkl tree and commit 8123178eb9ca12cde31a95170746e15a79528a62
> ("push BKL down into ->put_super") from the vfs tree.
> 
> OK, I am not sure what is needed here, so I combined both (see below).  I
> can carry this fixup as necessary.
> 
> -- 
> Cheers,
> Stephen Rothwell                    sfr@...b.auug.org.au
> 
> diff --cc fs/reiserfs/super.c
> index b301f7d,90dcb7b..0000000
> --- a/fs/reiserfs/super.c
> +++ b/fs/reiserfs/super.c
> @@@ -468,13 -465,11 +465,18 @@@ static void reiserfs_put_super(struct s
>   	struct reiserfs_transaction_handle th;
>   	th.t_trans_id = 0;
>   
> + 	lock_kernel();
> + 
>  +	/*
>  +	 * We didn't need to explicitly lock here before, because put_super
>  +	 * is called with the bkl held.
>  +	 * Now that we have our own lock, we must explicitly lock.
>  +	 */
>  +	reiserfs_write_lock(s);


Hi Stephen,


I'm not sure how this conflict look like.
But yeah, you need both.

The write lock, which was the bkl before, has been placed explicitly
since the write lock is a mutex and the locking does not depend anymore
on the bkl.

I also think the bkl pushdown in reiserfs is not needed, since it now
protects itself from concurrent reiserfs_put_super() using its own lock.
But although it is not needed, it should be removed in a separate commit.

So for now, IMO you have the right fix. The end result should be:

static void reiserfs_put_super(struct super_block *s)
{
	struct reiserfs_transaction_handle th;
	th.t_trans_id = 0;

	lock_kernel();
	/*
	 * We didn't need to explicitly lock here before, because put_super
	 * is called with the bkl held.
	 * Now that we have our own lock, we must explicitly lock.
	 */
	reiserfs_write_lock(s);

	[...]

	reiserfs_write_unlock(s);
	mutex_destroy(&REISERFS_SB(s)->lock);
	kfree(s->s_fs_info);
	s->s_fs_info = NULL;

	unlock_kernel();
}




> + 	if (s->s_dirt)
> + 		reiserfs_write_super(s);



But this part seems to solve another conflict, right?
I'm not sure about it.


Frederic.


> + 
>   	/* change file system state to current state if it was mounted with read-write permissions */
>   	if (!(s->s_flags & MS_RDONLY)) {
>   		if (!journal_begin(&th, s, 10)) {

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ