linux/fs/xfs/libxfs
Darrick J. Wong 174edb0e46 xfs: store in-progress CoW allocations in the refcount btree
Due to the way the CoW algorithm in XFS works, there's an interval
during which blocks allocated to handle a CoW can be lost -- if the FS
goes down after the blocks are allocated but before the block
remapping takes place.  This is exacerbated by the cowextsz hint --
allocated reservations can sit around for a while, waiting to get
used.

Since the refcount btree doesn't normally store records with refcount
of 1, we can use it to record these in-progress extents.  In-progress
blocks cannot be shared because they're not user-visible, so there
shouldn't be any conflicts with other programs.  This is a better
solution than holding EFIs during writeback because (a) EFIs can't be
relogged currently, (b) even if they could, EFIs are bound by
available log space, which puts an unnecessary upper bound on how much
CoW we can have in flight, and (c) we already have a mechanism to
track blocks.

At mount time, read the refcount records and free anything we find
with a refcount of 1 because those were in-progress when the FS went
down.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
2016-10-05 16:26:05 -07:00
..
xfs_ag_resv.c xfs: set up per-AG free space reservations 2016-09-19 10:30:52 +10:00
xfs_ag_resv.h xfs: set up per-AG free space reservations 2016-09-19 10:30:52 +10:00
xfs_alloc_btree.c xfs: remove the get*keys and update_keys btree ops pointers 2016-08-03 12:22:12 +10:00
xfs_alloc_btree.h
xfs_alloc.c xfs: reserve AG space for the refcount btree root 2016-10-03 09:11:24 -07:00
xfs_alloc.h Merge branch 'xfs-4.9-log-recovery-fixes' into for-next 2016-10-03 09:56:28 +11:00
xfs_attr_leaf.c xfs: rename flist/free_list to dfops 2016-08-03 11:19:29 +10:00
xfs_attr_leaf.h xfs: make several functions static 2016-06-01 17:38:15 +10:00
xfs_attr_remote.c xfs: rename flist/free_list to dfops 2016-08-03 11:19:29 +10:00
xfs_attr_remote.h
xfs_attr_sf.h xfs: move struct xfs_attr_shortform to xfs_da_format.h 2016-02-08 15:00:01 +11:00
xfs_attr.c xfs: rename flist/free_list to dfops 2016-08-03 11:19:29 +10:00
xfs_bit.c libxfs: Optimize the loop for xfs_bitmap_empty 2016-01-04 16:10:19 +11:00
xfs_bit.h
xfs_bmap_btree.c xfs: introduce the CoW fork 2016-10-04 18:06:40 -07:00
xfs_bmap_btree.h
xfs_bmap.c xfs: store in-progress CoW allocations in the refcount btree 2016-10-05 16:26:05 -07:00
xfs_bmap.h xfs: support removing extents from CoW fork 2016-10-05 13:55:40 -07:00
xfs_btree.c xfs: define the on-disk refcount btree format 2016-10-03 09:11:18 -07:00
xfs_btree.h xfs: define the on-disk refcount btree format 2016-10-03 09:11:18 -07:00
xfs_cksum.h
xfs_da_btree.c xfs: rename flist/free_list to dfops 2016-08-03 11:19:29 +10:00
xfs_da_btree.h xfs: rename flist/free_list to dfops 2016-08-03 11:19:29 +10:00
xfs_da_format.c xfs: kill xfs_dir2_inou_t 2016-07-20 11:48:31 +10:00
xfs_da_format.h xfs: fix attr shortform structure alignment on cris 2016-08-03 10:59:42 +10:00
xfs_defer.c xfs: defer should allow ->finish_item to request a new transaction 2016-09-19 10:26:25 +10:00
xfs_defer.h xfs: implement deferred bmbt map/unmap operations 2016-10-04 11:05:44 -07:00
xfs_dir2_block.c xfs: print name of verifier if it fails 2016-01-04 16:10:19 +11:00
xfs_dir2_data.c xfs: print name of verifier if it fails 2016-01-04 16:10:19 +11:00
xfs_dir2_leaf.c xfs: print name of verifier if it fails 2016-01-04 16:10:19 +11:00
xfs_dir2_node.c xfs: always set rvalp in xfs_dir2_node_trim_free 2016-03-15 11:44:18 +11:00
xfs_dir2_priv.h xfs: move type conversion functions to xfs_dir.h 2014-12-04 09:43:17 +11:00
xfs_dir2_sf.c xfs: kill xfs_dir2_inou_t 2016-07-20 11:48:31 +10:00
xfs_dir2.c xfs: rename flist/free_list to dfops 2016-08-03 11:19:29 +10:00
xfs_dir2.h xfs: rename flist/free_list to dfops 2016-08-03 11:19:29 +10:00
xfs_dquot_buf.c xfs: handle dquot buffer readahead in log recovery correctly 2016-01-12 07:04:01 +11:00
xfs_format.h xfs: store in-progress CoW allocations in the refcount btree 2016-10-05 16:26:05 -07:00
xfs_fs.h xfs: add reflink feature flag to geometry 2016-10-04 18:06:40 -07:00
xfs_ialloc_btree.c xfs: set up per-AG free space reservations 2016-09-19 10:30:52 +10:00
xfs_ialloc_btree.h xfs: allocate sparse inode chunks on full chunk allocation failure 2015-05-29 09:18:32 +10:00
xfs_ialloc.c xfs: add owner field to extent allocation and freeing 2016-08-03 11:33:42 +10:00
xfs_ialloc.h xfs: rename flist/free_list to dfops 2016-08-03 11:19:29 +10:00
xfs_inode_buf.c xfs: rework xfs_bmap_free callers to use xfs_defer_ops 2016-08-03 11:15:38 +10:00
xfs_inode_buf.h xfs: mode di_mode to vfs inode 2016-02-09 16:54:58 +11:00
xfs_inode_fork.c xfs: introduce the CoW fork 2016-10-04 18:06:40 -07:00
xfs_inode_fork.h xfs: introduce the CoW fork 2016-10-04 18:06:40 -07:00
xfs_log_format.h xfs: create bmbt update intent log items 2016-10-04 11:05:43 -07:00
xfs_log_recover.h xfs: support a crc verification only log record pass 2016-01-04 15:55:10 +11:00
xfs_log_rlimit.c xfs: move most of xfs_sb.h to xfs_format.h 2014-11-28 14:27:09 +11:00
xfs_quota_defs.h xfs: wire up Q_XGETNEXTQUOTA / get_nextdqblk 2016-02-08 11:27:38 +11:00
xfs_refcount_btree.c xfs: add refcount btree operations 2016-10-03 09:11:19 -07:00
xfs_refcount_btree.h xfs: define the on-disk refcount btree format 2016-10-03 09:11:18 -07:00
xfs_refcount.c xfs: store in-progress CoW allocations in the refcount btree 2016-10-05 16:26:05 -07:00
xfs_refcount.h xfs: store in-progress CoW allocations in the refcount btree 2016-10-05 16:26:05 -07:00
xfs_rmap_btree.c xfs: introduce refcount btree definitions 2016-10-03 09:11:16 -07:00
xfs_rmap_btree.h xfs: support overlapping intervals in the rmap btree 2016-08-03 11:40:56 +10:00
xfs_rmap.c xfs: introduce the CoW fork 2016-10-04 18:06:40 -07:00
xfs_rmap.h xfs: propagate bmap updates to rmapbt 2016-08-03 12:16:05 +10:00
xfs_rtbitmap.c xfs: make several functions static 2016-06-01 17:38:15 +10:00
xfs_sb.c xfs: define the on-disk refcount btree format 2016-10-03 09:11:18 -07:00
xfs_sb.h xfs: remove unused function definitions 2016-02-08 14:58:07 +11:00
xfs_shared.h xfs: define the on-disk refcount btree format 2016-10-03 09:11:18 -07:00
xfs_symlink_remote.c xfs: print name of verifier if it fails 2016-01-04 16:10:19 +11:00
xfs_trans_resv.c xfs: account for the refcount btree in the alloc/free log reservation 2016-10-03 09:11:19 -07:00
xfs_trans_resv.h xfs: define the on-disk refcount btree format 2016-10-03 09:11:18 -07:00
xfs_trans_space.h xfs: clean up XFS_MIN_FREELIST macros 2015-06-22 10:13:30 +10:00
xfs_types.h xfs: introduce the CoW fork 2016-10-04 18:06:40 -07:00