From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot0-x233.google.com (mail-ot0-x233.google.com [IPv6:2607:f8b0:4003:c0f::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D7D68225501D0 for ; Thu, 29 Mar 2018 15:56:07 -0700 (PDT) Received: by mail-ot0-x233.google.com with SMTP id i28-v6so8013419otf.8 for ; Thu, 29 Mar 2018 16:02:48 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20180329160215.glnrmyunujcc4vwg@quack2.suse.cz> References: <152167302988.5268.4370226749268662682.stgit@dwillia2-desk3.amr.corp.intel.com> <152167306807.5268.8483232024444414342.stgit@dwillia2-desk3.amr.corp.intel.com> <20180329160215.glnrmyunujcc4vwg@quack2.suse.cz> From: Dan Williams Date: Thu, 29 Mar 2018 16:02:45 -0700 Message-ID: Subject: Re: [PATCH v7 07/14] fs, dax: use page->mapping to warn if truncate collides with a busy page List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: Jan Kara Cc: Matthew Wilcox , linux-nvdimm , david , Linux Kernel Mailing List , linux-xfs , linux-fsdevel , Christoph Hellwig List-ID: On Thu, Mar 29, 2018 at 9:02 AM, Jan Kara wrote: > On Wed 21-03-18 15:57:48, Dan Williams wrote: [..] > I find it quite tricky that in case we pass zero page / empty entry into > dax_[dis]associate_entry(), it will not do anything because > dax_entry_size() will return 0. Can we add an explicit check into > dax_[dis]associate_entry() or at least a comment there? How about the following, i.e. rename the loop helper to for_each_dax_pfn() to make it clearer that we're only operating on mapped pfns, and also add a comment to indicate the same: /* * Iterate through all mapped pfns represented by an entry, i.e. skip * 'empty' and 'zero' entries. */ #define for_each_dax_pfn(entry, pfn) \ for (pfn = dax_radix_pfn(entry); \ pfn < dax_radix_end_pfn(entry); pfn++) _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm