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]
Message-ID: <alpine.DEB.2.00.1111091828500.32414@chino.kir.corp.google.com>
Date:	Wed, 9 Nov 2011 18:43:58 -0800 (PST)
From:	David Rientjes <rientjes@...gle.com>
To:	Shaohua Li <shaohua.li@...el.com>
cc:	Andrea Arcangeli <aarcange@...hat.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-mm <linux-mm@...ck.org>,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: [patch 1/5]thp: improve the error code path

On Thu, 10 Nov 2011, Shaohua Li wrote:

> > hugepage_attr_group is defined even if CONFIG_SYSFS is not set and I
> > just made a build with CONFIG_SYSFS=n and it builds just fine without
> > any change.
> 
> > $ grep CONFIG_SYSFS .config
> > # CONFIG_SYSFS is not set
> > 
> > So we can drop 1/5 above.
> this isn't the case in the code. And the code uses hugepage_attr_group
> is already within CONFIG_SYSFS, so your build success.
> 

You're right, but I agree that the #ifdef's just make the function error 
handling much too complex.  Would you mind adding sysfs_*_out labels at 
the end of the function to handle these errors instead?  And I think we 
should be doing khugepaged_slab_init() and mm_slots_hash_init() before 
initializing sysfs.

Something like

	out:
		khugepaged_slab_free();
		mm_slots_hash_free();	<-- after you remove it from #if 0
		return err;

	#ifdef CONFIG_SYSFS
	sysfs_khugepaged_out:
		sysfs_remove_group(hugepage_kobj, &khugepaged_attr_group);
	sysfs_hugepage_out:
		sysfs_remove_group(hugepage_kobj, &hugepage_attr_group);
		...
		goto out;
	#endif
--
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