linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: dsterba@suse.cz, Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v5.1 00/12] btrfs: Enhancement to tree block validation
Date: Thu, 21 Feb 2019 08:37:40 +0800	[thread overview]
Message-ID: <0f20234c-5fa7-8059-094d-b12e4e9963d0@gmx.com> (raw)
In-Reply-To: <20190220182544.GZ9874@twin.jikos.cz>


[-- Attachment #1.1: Type: text/plain, Size: 4919 bytes --]



On 2019/2/21 上午2:25, David Sterba wrote:
> On Mon, Feb 18, 2019 at 01:27:41PM +0800, Qu Wenruo wrote:
>> Patchset can be fetched from github:
>> https://github.com/adam900710/linux/tree/write_time_tree_checker
>> Which is based on v5.0-rc1 tag.
> 
> Please base the patches on something new, a recent rc is fine (rc6 or
> rc7 depends what you've tested).

Any recommended workflow for different timing point?
E.g. always rebase to latest rc?

My current (and now is proven not proper) workflow is to stick with
-rc1, and cherry pick known fixes related to test.
This provides a stable base run to spot regression caused by my patches.

> 
>> Also there is no conflict rebasing the patchset to misc-next.
> 
> The patches can apply on top of misc-next, but I've seen some hunks
> applied with offset. While git is good, mismerges can still happen, so
> if you do the rebase on your side it lowers the risk.

No problem, I'll change the my workflow to more proper one.

> 
>> This patchset has the following 3 features:
>> - Tree block validation output enhancement
>>   * Output validation failure timing (write time or read time)
>>   * Always output tree block level/key mismatch error message
>>     This part is already submitted and reviewed.
>>
>> - Write time tree block validation check
>>   To catch memory corruption either from hardware or kernel.
>>   Example output would be:
>>
>>     BTRFS critical (device dm-3): corrupt leaf: root=2 block=1350630375424 slot=68, bad key order, prev (10510212874240 169 0) current (1714119868416 169 0)
>>     BTRFS error (device dm-3): block=1350630375424 write time tree block corruption detected
>>     BTRFS: error (device dm-3) in btrfs_commit_transaction:2220: errno=-5 IO failure (Error while writing out transaction)
>>     BTRFS info (device dm-3): forced readonly
>>     BTRFS warning (device dm-3): Skipping commit of aborted transaction.
>>     BTRFS: error (device dm-3) in cleanup_transaction:1839: errno=-5 IO failure
>>     BTRFS info (device dm-3): delayed_refs has NO entry
>>
>> - Better error handling before calling flush_write_bio()
>>   One hidden reason of calling flush_write_bio() under all cases is,
>>   flush_write_bio() will trigger endio function and endio function of
>>   epd->bio will free the bio under all cases.
>>   So we're in fact abusing flush_write_bio() as cleanup.
>>
>>   Since now flush_write_bio() has its own return value, we shouldn't call
>>   flush_write_bio() no-brain, here we introduce proper cleanup helper,
>>   end_write_bio(). Now we call flush_write_bio() like:
>>               New                 |           Old
>>   --------------------------------------------------------------
>>   ret = do_some_evil(&epd);       | ret = do_some_evil(&epd);
>>   if (ret < 0) {                  | flush_write_bio(&epd);
>>   	end_write_bio(&epd, ret); | ^^^ submitting half-backed epd->bio?
>>   	return ret;               | return ret;
>>   }                               |
>>   ret = flush_write_bio(&epd);    |
>>   return ret;                     |
>>
>>   Above code should be more streamline for the error handling part.
>>
>> Changelog:
>> v2:
>> - Unlock locked pages in lock_extent_buffer_for_io() for error handling.
>> - Added Reviewed-by tags.
>>
>> v3:
>> - Remove duplicated error message.
>> - Use IS_ENABLED() macro to replace #ifdef.
>> - Added Reviewed-by tags.
>>
>> v4:
>> - Re-organized patch split
>>   Now each BUG_ON() cleanup has its own patch
>> - Dig much further into the call sites to eliminate unexpected >0 return
>>   May be a little paranoid and abuse some ASSERT(), but it should be
>>   much safer against further code change.
>> - Fix the false alert caused by balance and memory pressure
>>   The fix it skip owner checker for non-essential tree at write time.
>>   Since owner root can't always be reliable, either due to commit root
>>   created in current transaction or balance + memory pressure.
>>
>> v5:
>> - Do proper error-out handling other than relying on flush_write_bio()
>>   to clean up.
>>   This has a side effect that no Reviewed-by tags for modified patches.
>> - New comment for why we don't need to do anything about ebp->bio when
>>   submit_one_bio() fails.
>> - Add some Reviewed-by tag.
>>
>> v5.1:
>> - Add "block=%llu " output for write/read time error line.
>> - Also output read time error message for fsid/start/level check.
> 
> The patchset is in a good shape, I like the detailed changelogs and
> example messages. I'll give it some more testing though merging to 5.1
> does not seem to be feasible now but we'll see.

I'm fine with v5.2.

Just wonder if I need to rebase to v5.1-rc1 later on?

Thanks,
Qu

> The improved error
> handling is not really a feature so a late pull request could be ok for
> that.
> 
> Thanks.
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-02-21  0:38 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-18  5:27 [PATCH v5.1 00/12] btrfs: Enhancement to tree block validation Qu Wenruo
2019-02-18  5:27 ` [PATCH v5.1 01/12] btrfs: Always output error message when key/level verification fails Qu Wenruo
2019-02-18  5:27 ` [PATCH v5.1 02/12] btrfs: extent_io: Kill the forward declaration of flush_write_bio() Qu Wenruo
2019-02-18  5:27 ` [PATCH v5.1 03/12] btrfs: disk-io: Show the timing of corrupted tree block explicitly Qu Wenruo
2019-02-23  4:38   ` [PATCH v5.2 " Qu Wenruo
2019-02-18  5:27 ` [PATCH v5.1 04/12] btrfs: extent_io: Move the BUG_ON() in flush_write_bio() one level up Qu Wenruo
2019-02-18  5:27 ` [PATCH v5.1 05/12] btrfs: extent_io: Handle error better in extent_write_full_page() Qu Wenruo
2019-02-18  5:27 ` [PATCH v5.1 06/12] btrfs: extent_io: Handle error better in btree_write_cache_pages() Qu Wenruo
2019-02-18  5:27 ` [PATCH v5.1 07/12] btrfs: extent_io: Kill the dead branch in extent_write_cache_pages() Qu Wenruo
2019-02-18  5:27 ` [PATCH v5.1 08/12] btrfs: extent_io: Handle error better in extent_write_locked_range() Qu Wenruo
2019-02-18  5:27 ` [PATCH v5.1 09/12] btrfs: extent_io: Kill the BUG_ON() in lock_extent_buffer_for_io() Qu Wenruo
2019-02-18  5:27 ` [PATCH v5.1 10/12] btrfs: extent_io: Kill the BUG_ON() in extent_write_cache_pages() Qu Wenruo
2019-03-12  0:33   ` David Sterba
2019-03-12  0:42     ` Qu Wenruo
2019-03-13 11:31       ` David Sterba
2019-03-13 12:02         ` Qu Wenruo
2019-03-15  6:27   ` [PATCH v5.2 " Qu Wenruo
2019-02-18  5:27 ` [PATCH v5.1 11/12] btrfs: extent_io: Handle error better in extent_writepages() Qu Wenruo
2019-02-18  5:27 ` [PATCH v5.1 12/12] btrfs: Do mandatory tree block check before submitting bio Qu Wenruo
2019-02-18  9:26   ` Nikolay Borisov
2019-02-18  9:32     ` Qu Wenruo
2019-02-20 18:11       ` David Sterba
2019-02-20 18:25 ` [PATCH v5.1 00/12] btrfs: Enhancement to tree block validation David Sterba
2019-02-21  0:37   ` Qu Wenruo [this message]
2019-02-22 15:38     ` David Sterba
2019-02-21  4:49 ` Qu Wenruo
2019-02-22 15:18 ` David Sterba
2019-02-23  0:47   ` Qu Wenruo
2019-02-27 12:22     ` David Sterba
2019-02-27 13:40       ` Qu Wenruo

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=0f20234c-5fa7-8059-094d-b12e4e9963d0@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.com \
    /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).