Skip to content

Btrfs: orphan and truncate fixes

Omar Sandoval linux-btrfs oe-lkp 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest12 patches 4 repliesIn review
  2. v311 patches 12 repliesSuperseded
  3. v212 patches 7 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v110 patches9 repliesSuperseded

Changes in v4 from the cover letter

- Changed another stale comment in patch 1
- Moved BTRFS_INODE_ORPHAN_META_RESERVED flag removal to patch 10 instead of patch 9
- Moved inode runtime flag renumbering to a separate patch (patch 11)
- Added some more reviewed-bys

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12Btrfs: update stale comments referencing vmtruncate()fs/btrfs/inode.c+2 -30 replies
2/12Btrfs: fix error handling in btrfs_truncate_inode_items()fs/btrfs/inode.c+28 -270 replies
3/12Btrfs: don't BUG_ON() in btrfs_truncate_inode_items()fs/btrfs/inode.c+4 -11 reply
4/12Btrfs: stop creating orphan items for truncatefs/btrfs/free-space-cache.c fs/btrfs/inode.c+51 -1140 replies
5/12Btrfs: get rid of BTRFS_INODE_HAS_ORPHAN_ITEMfs/btrfs/btrfs_inode.h fs/btrfs/inode.c+20 -570 replies
6/12Btrfs: delete dead code in btrfs_orphan_commit_root()fs/btrfs/inode.c+0 -120 replies
7/12Btrfs: don't return ino to ino cache if inode item removal failsfs/btrfs/inode.c+13 -120 replies
8/12Btrfs: refactor btrfs_evict_inode() reserve refill dancefs/btrfs/inode.c+42 -710 replies
9/12Btrfs: fix ENOSPC caused by orphan items reservationsfs/btrfs/inode.c+38 -1200 replies
10/12Btrfs: get rid of unused orphan infrastructurefs/btrfs/btrfs_inode.h fs/btrfs/ctree.h fs/btrfs/disk-io.c +3 more+1 -990 replies
11/12Btrfs: renumber BTRFS_INODE_ runtime flagsfs/btrfs/btrfs_inode.h+8 -81 reply
12/12Btrfs: reserve space for O_TMPFILE orphan item deletionfs/btrfs/inode.c+2 -10 replies

Reviews trailers per patch

10 of 12 patches have a Reviewed-by or Acked-by.

PatchNikolay BorisovJosef BacikFilipe MananaDavid Sterba
1/12
2/12R-b
3/12R-b R-b
4/12R-b
5/12R-b
6/12R-b
7/12R-b
8/12R-b
9/12R-b
10/12R-b
11/12
12/12R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v4 thread

Cover letter [PATCH v4 00/12] Btrfs: orphan and truncate fixes

From: Omar Sandoval <[email protected]>

Hi,

This is the fourth (and hopefully final) version of the orphan item early ENOSPC and related fixes.

Changes since v3:

- Changed another stale comment in patch 1
- Moved BTRFS_INODE_ORPHAN_META_RESERVED flag removal to patch 10 instead of patch 9
- Moved inode runtime flag renumbering to a separate patch (patch 11)
- Added some more reviewed-bys

Changes since v2:

- Add patch 5 to get rid of BTRFS_INODE_HAS_ORPHAN_ITEM
- Move patch 10 to patch 6
- Got rid of patch 5; the bug goes away in the process of removing code for patches 9 and 10
- Rename patch 10 batch to what it was called in v1

Changes since v1:

- Added two extra cleanups, patches 10 and 11
- Added a forgotten clear of the orphan bit in patch 8
- Reworded titles of patches 6 and 9
- Added people's reviewed-bys

Cover letter from v1:

At Facebook we hit an early ENOSPC issue which we tracked down to the reservations for orphan items of deleted-but-still-open files. The primary function of this series is to fix that bug, but I ended up uncovering a pile of other issues in the process, most notably that the orphan items we create for truncate are useless.

I've also posted an xfstest that reproduces this bug.

Thanks!

*** BLURB HERE ***

Omar Sandoval (12):
Btrfs: update stale comments referencing vmtruncate()
Btrfs: fix error handling in btrfs_truncate_inode_items()
Btrfs: don't BUG_ON() in btrfs_truncate_inode_items()
Btrfs: stop creating orphan items for truncate
Btrfs: get rid of BTRFS_INODE_HAS_ORPHAN_ITEM
Btrfs: delete dead code in btrfs_orphan_commit_root()
Btrfs: don't return ino to ino cache if inode item removal fails
Btrfs: refactor btrfs_evict_inode() reserve refill dance
Btrfs: fix ENOSPC caused by orphan items reservations
Btrfs: get rid of unused orphan infrastructure
Btrfs: renumber BTRFS_INODE_ runtime flags
Btrfs: reserve space for O_TMPFILE orphan item deletion

 fs/btrfs/btrfs_inode.h      |  18 +-
 fs/btrfs/ctree.h            |   8 -
 fs/btrfs/disk-io.c          |   9 -
 fs/btrfs/extent-tree.c      |  38 ---
 fs/btrfs/free-space-cache.c |   6 +-
 fs/btrfs/inode.c            | 580 ++++++++++--------------------------
 fs/btrfs/transaction.c      |   1 -
 7 files changed, 172 insertions(+), 488 deletions(-)
Signature · 1 line
2.17.0