From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Snitzer Subject: Re: dm barrier: A better test for -EOPNOTSUPP. Date: Thu, 8 Jul 2010 12:05:33 -0400 Message-ID: <20100708160532.GA17374@redhat.com> References: <20100708135226.GA3151@redhat.com> Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: Mikulas Patocka Cc: dm-devel@redhat.com, Alasdair G Kergon List-Id: dm-devel.ids On Thu, Jul 08 2010 at 11:52am -0400, Mikulas Patocka wrote: > > > On Thu, 8 Jul 2010, Mike Snitzer wrote: > > Doesn't store_barrier_error just record the result of the first empty > > barrier (not the -EOPNOTSUPP result of the unsupported discard)? > > > > I'm missing how this change helps avoid the 2nd barrier for the > > -EOPNOTSUPP discard case. > > > > ... And my testing shows that it doesn't. > > > > Mike > > Thanks for testing it. The errors of all the operations are accumulated in > in md->barrier_error in dec_pending. > > The problem was that it was ignoring -EOPNOTSUPP (assuming to ignore not > supported empty barriers), but this condition unexpectedly ignored > EOPNOTSUPP from the discard as well. > > Please test with this patch. > > Also, apply the patch to RHEL, because it is a bugfix (don't ignore > discard errors). > > Mikulas > > --- > > dm barrier: A better test for -EOPNOTSUPP. > > -EOPNOTSUPP could be generated only by empty barriers and we ignored that > error, assuming that device not supporting cache flushes has cache always > consistent. > > With addition of discard barriers, this -EOPNOTSUPP could be generated by > discards as well, and we can't ignore it. > > This patch refines the test for -EOPNOTSUPP, ignoring it only for empty > barrier requests. > > Signed-off-by: Mikulas Patocka Works great, thanks. Acked-by: Mike Snitzer