linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Liu Bo <bo.li.liu@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH v2 00/10] bugfixes and regression tests of btrfs_get_extent
Date: Fri,  5 Jan 2018 12:51:07 -0700	[thread overview]
Message-ID: <20180105195117.5131-1-bo.li.liu@oracle.com> (raw)

Although
commit e6c4efd87ab0 ("btrfs: Fix and enhance merge_extent_mapping() to insert best fitted extent map")
fixed up the negetive em->len, it has introduced several regressions, several has been fixed by

commit 32be3a1ac6d0 ("btrfs: Fix the wrong condition judgment about subset extent map"),
commit 8dff9c853410 ("Btrfs: deal with duplciates during extent_map insertion in btrfs_get_extent") and
commit 8e2bd3b7fac9 ("Btrfs: deal with existing encompassing extent map in btrfs_get_extent()").

Unfortunately, there is one more regression which is caught recently by a
user's workloads.

While debugging the above issue, I found that all of these bugs are caused
by some racy situations, which can be very tricky to reproduce, so I
created several extent map specific test cases in btrfs's selftest
framework.

Patch 1-2 are fixing two bugs.
Patch 3-4 are some preparatory work.
Patch 3-5 are regression tests about the logic of handling EEXIST from
adding extent map.
Patch 8-10 are debugging wise, one is a direct tracepoint and the other is
to enable kprobe on merge_extent_mapping.

v2:
- Improve commit log to provide more details about the bug.
- Adjust bugfixes to the front so that we can merge them firstly.

Liu Bo (10):
  Btrfs: fix incorrect block_len in merge_extent_mapping
  Btrfs: fix unexpected EEXIST from btrfs_get_extent
  Btrfs: add helper for em merge logic
  Btrfs: move extent map specific code to extent_map.c
  Btrfs: add extent map selftests
  Btrfs: extent map selftest: buffered write vs dio read
  Btrfs: extent map selftest: dio write vs dio read
  Btrfs: add WARN_ONCE to detect unexpected error from
    merge_extent_mapping
  Btrfs: add tracepoint for em's EEXIST case
  Btrfs: noinline merge_extent_mapping

 fs/btrfs/Makefile                 |   2 +-
 fs/btrfs/extent_map.c             | 134 ++++++++++++++
 fs/btrfs/extent_map.h             |   2 +
 fs/btrfs/inode.c                  | 108 +-----------
 fs/btrfs/tests/btrfs-tests.c      |   3 +
 fs/btrfs/tests/btrfs-tests.h      |   1 +
 fs/btrfs/tests/extent-map-tests.c | 363 ++++++++++++++++++++++++++++++++++++++
 include/trace/events/btrfs.h      |  35 ++++
 8 files changed, 540 insertions(+), 108 deletions(-)
 create mode 100644 fs/btrfs/tests/extent-map-tests.c

-- 
2.9.4


             reply	other threads:[~2018-01-06  0:08 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-05 19:51 Liu Bo [this message]
2018-01-05 19:51 ` [PATCH v2 01/10] Btrfs: fix incorrect block_len in merge_extent_mapping Liu Bo
2018-01-09 17:24   ` Josef Bacik
2018-01-05 19:51 ` [PATCH v2 02/10] Btrfs: fix unexpected EEXIST from btrfs_get_extent Liu Bo
2018-01-09 17:27   ` Josef Bacik
2018-01-05 19:51 ` [PATCH v2 03/10] Btrfs: add helper for em merge logic Liu Bo
2018-01-09 17:27   ` Josef Bacik
2018-01-05 19:51 ` [PATCH v2 04/10] Btrfs: move extent map specific code to extent_map.c Liu Bo
2018-01-09 17:29   ` Josef Bacik
2018-01-05 19:51 ` [PATCH v2 05/10] Btrfs: add extent map selftests Liu Bo
2018-01-09 17:31   ` Josef Bacik
2018-01-05 19:51 ` [PATCH v2 06/10] Btrfs: extent map selftest: buffered write vs dio read Liu Bo
2018-01-09 17:32   ` Josef Bacik
2018-01-05 19:51 ` [PATCH v2 07/10] Btrfs: extent map selftest: dio " Liu Bo
2018-01-09 17:32   ` Josef Bacik
2018-01-05 19:51 ` [PATCH v2 08/10] Btrfs: add WARN_ONCE to detect unexpected error from merge_extent_mapping Liu Bo
2018-01-09 17:33   ` Josef Bacik
2018-01-05 19:51 ` [PATCH v2 09/10] Btrfs: add tracepoint for em's EEXIST case Liu Bo
2018-01-09 17:35   ` Josef Bacik
2018-01-19 18:15   ` David Sterba
2018-01-19 18:22     ` Nikolay Borisov
2018-01-19 23:32       ` David Sterba
2018-01-05 19:51 ` [PATCH v2 10/10] Btrfs: noinline merge_extent_mapping Liu Bo
2018-01-09 17:35   ` Josef Bacik
2018-01-08 19:57 ` [PATCH v2 00/10] bugfixes and regression tests of btrfs_get_extent David Sterba
2018-01-18 16: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=20180105195117.5131-1-bo.li.liu@oracle.com \
    --to=bo.li.liu@oracle.com \
    --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).