From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Mason Subject: Re: [PATCH] block: fix DISCARD_BARRIER requests Date: Thu, 17 Jun 2010 15:22:17 -0400 Message-ID: <20100617192217.GT27466@think> References: <20100617075432.GA22407@lst.de> <4C19D86A.5030709@kernel.dk> <20100617165453.GA15824@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jens Axboe , linux-fsdevel@vger.kernel.org To: Christoph Hellwig Return-path: Received: from rcsinet10.oracle.com ([148.87.113.121]:63363 "EHLO rcsinet10.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933163Ab0FQTXr (ORCPT ); Thu, 17 Jun 2010 15:23:47 -0400 Content-Disposition: inline In-Reply-To: <20100617165453.GA15824@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Jun 17, 2010 at 06:54:53PM +0200, Christoph Hellwig wrote: > On Thu, Jun 17, 2010 at 10:10:18AM +0200, Jens Axboe wrote: > > Thanks, applied. There was a recent problem report on btrfs using > > discard, could possibly explain it if Chris assumed it was a full > > barrier. > > We actually have a much bigger issue with the DISCARD_BARRIER type. > If the discard request needs to get split into multiple smaller ones > we don't keep the queue drained atomically around them, so requests > could sneak inbetween them. Depending on how the realtime discard > is implemented that could cause issues. In my XFS prototype for it > I only deleted the extents from the tracking betree after the discard > request has returned, but other filesystems rely on full barrier > semantics of DISCARD_BARRIER this could cause real problems. btrfs needs to know that a write after the discard returns won't cross the discard, but beyond that we're happy with anything. -chris