linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: clean up btrfs_dev_stat_inc() usage
Date: Sat, 21 Oct 2017 01:34:26 +0800	[thread overview]
Message-ID: <884912c4-9590-b17c-5e35-3e4f9c417e67@oracle.com> (raw)
In-Reply-To: <20171020152717.GR3521@twin.jikos.cz>



On 10/20/2017 11:27 PM, David Sterba wrote:
> On Fri, Oct 20, 2017 at 05:50:59PM +0800, Anand Jain wrote:
>> btrfs_end_bio() is using btrfs_dev_stat_inc() and then
>> btrfs_dev_stat_print_on_error() separately instead
>> use btrfs_dev_stat_inc_and_print() directly.
>>
>> No need to worry about print lines one for read/write
>> and another if the source of IO request is flush, since
>> as mentioned in this patch
>>   [patch] btrfs: REQ_PREFLUSH does not use btrfs_end_bio() completion callback
> 
> I don't see such patch merged, I've only found
> https://patchwork.kernel.org/patch/9619949/
> so the remark in the changelog is insufficient to understand what you're
> referring to.
> 
> This patch itself looks good but the changelog should be improved.

  Sure will update.

Thanks, Anand


>> there isn't any IO which is doing that.
>>
>> This consolidation is a preparatory patch to add device
>> critical error handling in btrfs_dev_stat_inc_and_print()
>> and can be renamed as needed.
>>
>> Signed-off-by: Anand Jain <anand.jain@oracle.com>
>> ---
>>   fs/btrfs/volumes.c | 7 +++----
>>   1 file changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
>> index efaf85dd91b0..d1d8aa226bff 100644
>> --- a/fs/btrfs/volumes.c
>> +++ b/fs/btrfs/volumes.c
>> @@ -6004,15 +6004,14 @@ static void btrfs_end_bio(struct bio *bio)
>>   			dev = bbio->stripes[stripe_index].dev;
>>   			if (dev->bdev) {
>>   				if (bio_op(bio) == REQ_OP_WRITE)
>> -					btrfs_dev_stat_inc(dev,
>> +					btrfs_dev_stat_inc_and_print(dev,
>>   						BTRFS_DEV_STAT_WRITE_ERRS);
>>   				else
>> -					btrfs_dev_stat_inc(dev,
>> +					btrfs_dev_stat_inc_and_print(dev,
>>   						BTRFS_DEV_STAT_READ_ERRS);
>>   				if (bio->bi_opf & REQ_PREFLUSH)

  With reference to the un-merged patch I meant to say it never
  reaches this part since the

>> -					btrfs_dev_stat_inc(dev,
>> +					btrfs_dev_stat_inc_and_print(dev,
>>   						BTRFS_DEV_STAT_FLUSH_ERRS);



>> -				btrfs_dev_stat_print_on_error(dev);
>>   			}
>>   		}
>>   	}
>> -- 
>> 2.13.1
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2017-10-20 17:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-20  9:50 [PATCH] btrfs: clean up btrfs_dev_stat_inc() usage Anand Jain
2017-10-20 11:48 ` Nikolay Borisov
2017-10-20 15:27 ` David Sterba
2017-10-20 17:34   ` Anand Jain [this message]
2017-10-20 17:45 ` [PATCH v2] " Anand Jain
2017-10-30 12:51   ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=884912c4-9590-b17c-5e35-3e4f9c417e67@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).