From: Jan Kara Subject: Re: [PATCH v2 1/2] ext4: Close race between direct IO and ext4_break_layouts() Date: Tue, 11 Sep 2018 17:26:41 +0200 Message-ID: <20180911152641.GF6104@quack2.suse.cz> References: <153374910694.40645.17166196534680658204.stgit@djiang5-desk3.ch.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: lczerner-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, tytso-3s7WtUTddSA@public.gmane.org, linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org, darrick.wong-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org, david-FqsqvQoI3Ljby3iVrkZq2A@public.gmane.org, linux-xfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, zwisler-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, jack-AlSwsSmVLrQ@public.gmane.org, linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, hch-jcswGhMUV9g@public.gmane.org To: sandeen-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org Sender: "Linux-nvdimm" List-Id: linux-ext4.vger.kernel.org On Mon 10-09-18 11:23:56, Eric Sandeen wrote: > On 8/8/18 12:25 PM, Dave Jiang wrote: > > From: Ross Zwisler > > > > If the refcount of a page is lowered between the time that it is returned > > by dax_busy_page() and when the refcount is again checked in > > ext4_break_layouts() => ___wait_var_event(), the waiting function > > ext4_wait_dax_page() will never be called. This means that > > ext4_break_layouts() will still have 'retry' set to false, so we'll stop > > looping and never check the refcount of other pages in this inode. > > > > Instead, always continue looping as long as dax_layout_busy_page() gives us > > a page which it found with an elevated refcount. > > > > Signed-off-by: Ross Zwisler > > Reviewed-by: Jan Kara > > Ted - wondering if this one is still on your radar? Resent the patch to Ted to catch more attention. Honza -- Jan Kara SUSE Labs, CR