linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Remi Gauvin <remi@georgianit.com>,
	linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: BTRFS corruption, mounts but comes read-only
Date: Sun, 6 Oct 2019 07:18:02 +0800	[thread overview]
Message-ID: <7f0f3aea-febe-022c-400a-8e846b0b17da@gmx.com> (raw)
In-Reply-To: <e546074f-4292-32c5-fe6b-170ace2f63f7@georgianit.com>


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



On 2019/10/6 上午1:14, Remi Gauvin wrote:
> On 2019-09-30 9:53 p.m., Qu Wenruo wrote:
> 
>>
>> It's indeed a symptom of btrfs kernel module bug. But at least looks
>> repairable.
>>
> 
> As advertised, btrfs --check repair restored the FS to full function.

Yep, btrfs check --repair is getting better and better.

As long as btrfs check (no --repair) after --repair reports no error,
you're completely OK to go.

But as you already found, btrfs check (by default) only cares metadata,
while ignores all data, so you still need another scrub to fix data error.

In fact you can use --check-data-csum to make btrfs check to
check/repair data csum error too. (kinda like scrub).

> 
> A follow-up scrub even found and corrected some corrupt data on one of
> the disks, that went  completely unreported by the disk itself.  So,
> despite this hiccup, BTRFS did it's job admirably.
> 
> 
> Whenever I do any further btrfs check after cleanly unmounting the
> filesystem, I get this error:
> 
> cache and super generation don't match, space cache will be invalidated

It's not an error, just a warning.
Kernel will just discard that cache.

> 
> Even mounting with clear_cache,nospace_cache , (then mounting again with
> space_cache=v2) does not remove this warning.  But it doesn't seem to be
> causing any problems.. There are no warnings about the space cache in
> the dmesg log when the filesystem is mounted.

Clear cache doesn't really clear the cache.
Only block group got modified will delete its cache file.

To fully clear the cache, you can go btrfs check --clear-space-cache v1.

Thanks,
Qu


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

      reply	other threads:[~2019-10-05 23:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-30 19:57 Remi Gauvin
2019-09-30 21:08 ` Remi Gauvin
2019-10-01  1:30   ` Qu Wenruo
2019-10-01  1:41     ` Remi Gauvin
2019-10-01  1:53       ` Qu Wenruo
2019-10-05 17:14         ` Remi Gauvin
2019-10-05 23:18           ` Qu Wenruo [this message]

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=7f0f3aea-febe-022c-400a-8e846b0b17da@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=remi@georgianit.com \
    --subject='Re: BTRFS corruption, mounts but comes read-only' \
    /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

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).