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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 22 Nov 2007 02:47:50 +0300
From:	Dmitri Vorobiev <dmitri.vorobiev@...il.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
CC:	zach.brown@...cle.com, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [2.6.24-rc3-mm1] loop cleanup in fs/namespace.c - repost

Andrew Morton пишет:
> On Thu, 22 Nov 2007 01:49:19 +0300
> Dmitri Vorobiev <dmitri.vorobiev@...il.com> wrote:
> 
>> Zach Brown пишет:
>>>>> This doesn't look fine.  Did you test this?
>>>> Oops, my fault. Of course, I tested the patch, but kernel modules are
>>>> disabled in my test setup, so I missed the error.
>>> :)
>>>
>>>> Enclosed to this message is a new patch, which replaces the goto-loop by
>>>> the while-based one, but leaves the EXPORT_SYMBOL macro intact.
>>> It certainly looks OK to me now, for whatever that's worth. 
>> Zach, thank you for the code review and suggestions.
>>
>>> You probably want to wait 'till the next merge window to get it in,
>>> though.  It's just a cleanup and so shouldn't go in this late in the -rc
>>> line.
>>>
>>> Maybe Andrew will be willing to queue it until that time in -mm.
>> I am enclosing the patch against current -mm tree and adding Andrew to the Cc: list.
>>
>> Thanks,
>>
>> Dmitri
>>
>>> - z
>>>
>>
> [loop-cleanup-fs-namespace-mm.diff  text/x-patch (742B)]
> Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@...il.com>
> ---
> diff --git a/fs/namespace.c b/fs/namespace.c
> index 79883fe..b098b63 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -606,19 +606,17 @@ static inline void __mntput(struct vfsmo
>  
>  void mntput_no_expire(struct vfsmount *mnt)
>  {
> -repeat:
> -	if (atomic_dec_and_lock(&mnt->mnt_count, &vfsmount_lock)) {
> +	while (atomic_dec_and_lock(&mnt->mnt_count, &vfsmount_lock)) {
>  		if (likely(!mnt->mnt_pinned)) {
>  			spin_unlock(&vfsmount_lock);
>  			__mntput(mnt);
> -			return;
> +			break;
>  		}
>  		atomic_add(mnt->mnt_pinned + 1, &mnt->mnt_count);
>  		mnt->mnt_pinned = 0;
>  		spin_unlock(&vfsmount_lock);
>  		acct_auto_close_mnt(mnt);
>  		security_sb_umount_close(mnt);
> -		goto repeat;
>  	}
>  }
>  
> This patch has no changelog which I can use.
> 
> 

Andrew, thanks for the quick reply. I believe that a couple of sentences is enough for the changelog entry, so here it goes...

From: Dmitri Vorobiev <dmitri.vorobiev@...il.com>

The mntput_no_expire() routine implements a simple loop using the goto-based construct. Replace this with an equivalent while-based loop, which looks much cleaner in C code.



View attachment "loop-cleanup-fs-namespace-mm.diff" of type "text/x-patch" (742 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ