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: <20161205205537.GB31465@mwanda>
Date:   Mon, 5 Dec 2016 23:55:37 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     James Simmons <jsimmons@...radead.org>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        devel@...verdev.osuosl.org,
        Andreas Dilger <andreas.dilger@...el.com>,
        Oleg Drokin <oleg.drokin@...el.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Jinshan Xiong <jinshan.xiong@...el.com>,
        Lustre Development List <lustre-devel@...ts.lustre.org>
Subject: Re: [PATCH 04/22] staging: lustre: osc: handle osc eviction correctly

On Fri, Dec 02, 2016 at 07:53:11PM -0500, James Simmons wrote:
> @@ -3183,8 +3182,10 @@ static int discard_cb(const struct lu_env *env, struct cl_io *io,
>  	/* page is top page. */
>  	info->oti_next_index = osc_index(ops) + 1;
>  	if (cl_page_own(env, io, page) == 0) {
> -		KLASSERT(ergo(page->cp_type == CPT_CACHEABLE,
> -			      !PageDirty(cl_page_vmpage(page))));
> +		if (!ergo(page->cp_type == CPT_CACHEABLE,
> +			  !PageDirty(cl_page_vmpage(page))))
> +			CL_PAGE_DEBUG(D_ERROR, env, page,
> +				      "discard dirty page?\n");


I don't understand the point of the ergo macro.  There are way too many
double negatives (some of them hidden for my small brain).  How is that
simpler than just writing it out:

	if (page->cp_type == CPT_CACHEABLE &&
	    PageDirty(cl_page_vmpage(page))
		 CL_PAGE_DEBUG(D_ERROR, env, page, "discard dirty page?\n");

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ