linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: linux-btrfs@vger.kernel.org
Cc: dsterba@suse.cz
Subject: [PATCH 0/4] Add support to clear v1 free space cache for btrfs check
Date: Tue, 17 May 2016 11:47:54 +0800	[thread overview]
Message-ID: <1463456878-17550-1-git-send-email-quwenruo@cn.fujitsu.com> (raw)

The patchset can be also fetched from github, just in case mail list
blocks the last patch, which contains binary file.
https://github.com/adam900710/btrfs-progs.git fsck_clear_cache

Just as describe in the first patch, btrfs kernel "clear_cache" mount
option can't rebuild all free space cache, due to the design of free
space cache.
(Although I pretty like the idea to delay the load of free space cache,
as it hugely reduce the mount time of large fs)

So this makes users to report error in mail list, complaining
"clear_cache" doesn't wipe the annoying kernel warning on corrupted free
space cache.

Since kernel can't handle it, and user consider it more like an error,
we'd better handle it like an error, to fix it in btrfs check.

So this patchset adds the ability to clear free space cache, and add
test case for it.

The clear procedure is different from kernel, it will remove all free
space cache inodes and its contents(with backrefs), and set
cache_generation of super block to -1.
So there will be no free space cache at all and kernel will be happy
with that.

This patch also enhances btrfs_previous_item() to use min_objectid to
return as early as possible.

Lu Fengqi (1):
  btrfs-progs: tests: add 020-bad-free-space-cache

Qu Wenruo (3):
  btrfs-progs: corrupt-block: Add ability to corrupt free space cache
    file
  btrfs-progs: ctree: return earlier for btrfs_previous_item
  btrfs-progs: fsck: Add support to clear free space cache

 Documentation/btrfs-check.asciidoc                 |   8 ++
 btrfs-corrupt-block.c                              | 124 ++++++++++++++++++++-
 cmds-check.c                                       |  58 +++++++++-
 ctree.c                                            |   2 +
 free-space-cache.c                                 | 124 +++++++++++++++++++++
 free-space-cache.h                                 |   4 +
 .../020-bad-free-space-cache/default_case.raw.xz   | Bin 0 -> 164068 bytes
 tests/fsck-tests/020-bad-free-space-cache/test.sh  |  16 +++
 8 files changed, 334 insertions(+), 2 deletions(-)
 create mode 100644 tests/fsck-tests/020-bad-free-space-cache/default_case.raw.xz
 create mode 100755 tests/fsck-tests/020-bad-free-space-cache/test.sh

-- 
2.8.2




             reply	other threads:[~2016-05-17  3:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-17  3:47 Qu Wenruo [this message]
2016-05-17  3:47 ` [PATCH 1/4] btrfs-progs: corrupt-block: Add ability to corrupt free space cache file Qu Wenruo
2016-05-17 13:00   ` David Sterba
2016-05-17 13:02     ` David Sterba
2016-05-18  0:49     ` Qu Wenruo
2016-05-17  3:47 ` [PATCH 2/4] btrfs-progs: ctree: return earlier for btrfs_previous_item Qu Wenruo
2016-05-17 12:50   ` David Sterba
2016-05-18  0:40     ` Qu Wenruo
2016-05-17  3:47 ` [PATCH 3/4] btrfs-progs: fsck: Add support to clear free space cache Qu Wenruo
2016-05-17  3:53   ` [PATCH v1.1 " Qu Wenruo
2016-05-17  3:47 ` [PATCH 4/4] btrfs-progs: tests: add 020-bad-free-space-cache Qu Wenruo
2016-05-17  3:56 ` [PATCH 0/4] Add support to clear v1 free space cache for btrfs check Qu Wenruo
2016-05-17 18:12   ` Ivan P
2016-05-18  1:00     ` Qu Wenruo
2016-05-19 16:54       ` Ivan P
2016-05-20  0:44         ` Qu Wenruo
2016-05-22 17:44           ` Ivan P
2016-05-23  1:18             ` Qu Wenruo
2016-05-18  9:14     ` 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=1463456878-17550-1-git-send-email-quwenruo@cn.fujitsu.com \
    --to=quwenruo@cn.fujitsu.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).