Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752396AbcLEU4Y (ORCPT ); Mon, 5 Dec 2016 15:56:24 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:20421 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752028AbcLEU4X (ORCPT ); Mon, 5 Dec 2016 15:56:23 -0500 Date: Mon, 5 Dec 2016 23:55:37 +0300 From: Dan Carpenter To: James Simmons Cc: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger , Oleg Drokin , Linux Kernel Mailing List , Jinshan Xiong , Lustre Development List Subject: Re: [PATCH 04/22] staging: lustre: osc: handle osc eviction correctly Message-ID: <20161205205537.GB31465@mwanda> References: <1480726409-20350-1-git-send-email-jsimmons@infradead.org> <1480726409-20350-5-git-send-email-jsimmons@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1480726409-20350-5-git-send-email-jsimmons@infradead.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 884 Lines: 23 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