From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:44295 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753073AbdC1PVK (ORCPT ); Tue, 28 Mar 2017 11:21:10 -0400 Date: Tue, 28 Mar 2017 17:19:56 +0200 From: David Sterba To: Anand Jain Cc: linux-btrfs@vger.kernel.org, dsterba@suse.cz, quwenruo@cn.fujitsu.com Subject: Re: [PATCH 1/4] btrfs: REQ_PREFLUSH does not use btrfs_end_bio() completion callback Message-ID: <20170328151956.GZ4781@twin.jikos.cz> Reply-To: dsterba@suse.cz References: <20170313074214.24123-1-anand.jain@oracle.com> <20170313074214.24123-2-anand.jain@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20170313074214.24123-2-anand.jain@oracle.com> Sender: linux-btrfs-owner@vger.kernel.org List-ID: On Mon, Mar 13, 2017 at 03:42:11PM +0800, Anand Jain wrote: > REQ_PREFLUSH bio to flush dev cache uses btrfs_end_empty_barrier() > completion callback only, as of now, and there it accounts for dev > stat flush errors BTRFS_DEV_STAT_FLUSH_ERRS, so remove it from the > btrfs_end_bio(). Can you please be more specific? I was trying to find the code path that does the supposedly duplicate accounting for BTRFS_DEV_STAT_FLUSH_ERRS, but still not there after half an hour. submit_stripe_bio btrfsic_submit_bio btrfs_end_bio -> stats accounting write_dev_flush btrfsic_submit_bio btrfs_end_empty_barrier complete now here it wakes up flush_wait, that is only waited for in write_dev_flush, there the FLUSH_ERRS accounting happens, but ... I'm not sure if I haven't lost in the bio handling maze.