[PATCH] btrfs: qgroup: move the qgroup->members check out from (!qgroup)'s else branch

2018-10-10 Thread Lu Fengqi
There is no reason to put this check in (!qgroup)'s else branch because if qgroup is null, it will goto out directly. So move it out to reduce indent. No Functional Change. Signed-off-by: Lu Fengqi --- fs/btrfs/qgroup.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff

[PATCH 0/6] Some trivail cleanup about dealyed-refs

2018-10-10 Thread Lu Fengqi
There is no functional change. Just improve readablity. PATCH 1-4 parameter cleanup patches PATCH 5 cleanup about btrfs_select_ref_head PATCH 6 switch int to bool; add some comment Lu Fengqi (6): btrfs: delayed-ref: pass delayed_refs directly to btrfs_select_ref_head() btrfs:

[PATCH 2/6] btrfs: delayed-ref: pass delayed_refs directly to btrfs_delayed_ref_lock()

2018-10-10 Thread Lu Fengqi
Since trans is only used for referring to delayed_refs, there is no need to pass it instead of delayed_refs to btrfs_delayed_ref_lock(). No functional change. Signed-off-by: Lu Fengqi --- fs/btrfs/delayed-ref.c | 5 + fs/btrfs/delayed-ref.h | 2 +- fs/btrfs/extent-tree.c | 2 +- 3 files

[PATCH 1/6] btrfs: delayed-ref: pass delayed_refs directly to btrfs_select_ref_head()

2018-10-10 Thread Lu Fengqi
Since trans is only used for referring to delayed_refs, there is no need to pass it instead of delayed_refs to btrfs_select_ref_head(). No functional change. Signed-off-by: Lu Fengqi --- fs/btrfs/delayed-ref.c | 5 + fs/btrfs/delayed-ref.h | 2 +- fs/btrfs/extent-tree.c | 2 +- 3 files

[PATCH 5/6] btrfs: simplify btrfs_select_ref_head and cleanup some local variables

2018-10-10 Thread Lu Fengqi
If the return value of find_ref_head() is NULL, the only possibility is that delayed_refs' head ref rbtree is empty. Hence, the second find_ref_head() is pointless. Besides, the local variables loop and start are unnecessary, just remove them. Signed-off-by: Lu Fengqi ---

[PATCH 4/6] btrfs: remove fs_info from btrfs_should_throttle_delayed_refs

2018-10-10 Thread Lu Fengqi
The avg_delayed_ref_runtime can be referenced from the transaction handle. Signed-off-by: Lu Fengqi --- fs/btrfs/ctree.h | 3 +-- fs/btrfs/extent-tree.c | 5 ++--- fs/btrfs/inode.c | 5 ++--- fs/btrfs/transaction.c | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git

[PATCH 3/6] btrfs: remove fs_info from btrfs_check_space_for_delayed_refs

2018-10-10 Thread Lu Fengqi
It can be referenced from the transaction handle. Signed-off-by: Lu Fengqi --- fs/btrfs/ctree.h | 3 +-- fs/btrfs/extent-tree.c | 6 +++--- fs/btrfs/inode.c | 2 +- fs/btrfs/transaction.c | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/ctree.h

[PATCH 6/6] btrfs: switch return_bigger to bool in find_ref_head

2018-10-10 Thread Lu Fengqi
Using bool is more suitable than int here, and add the comment about the return_bigger. Signed-off-by: Lu Fengqi --- fs/btrfs/delayed-ref.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c index

Re: [PATCH 17/25] vfs: enable remap callers that can handle short operations

2018-10-10 Thread Amir Goldstein
On Thu, Oct 11, 2018 at 7:14 AM Darrick J. Wong wrote: > > From: Darrick J. Wong > > Plumb in a remap flag that enables the filesystem remap handler to > shorten remapping requests for callers that can handle it. Now > copy_file_range can report partial success (in case we run up against >

Re: [PATCH v3] geneirc/077 fix min size for btrfs

2018-10-10 Thread Darrick J. Wong
On Thu, Oct 11, 2018 at 11:26:00AM +0800, Anand Jain wrote: > If btrfs need to be tested at its default blockgroup which is non-mixed, > then it needs at least 256mb. > > Signed-off-by: Anand Jain > --- > v2->v3: > separated from the patch set of 9. > notrun for the cases where

[PATCH 24/25] xfs: support returning partial reflink results

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Back when the XFS reflink code only supported clone_file_range, we were only able to return zero or negative error codes to userspace. However, now that copy_file_range (which returns bytes copied) can use XFS' clone_file_range, we have the opportunity to return partial

[PATCH 25/25] xfs: remove redundant remap partial EOF block checks

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Now that we've moved the partial EOF block checks to the VFS helpers, we can remove the redundantn functionality from XFS. Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_reflink.c | 20 1 file changed, 20 deletions(-) diff --git

[PATCH 22/25] ocfs2: support partial clone range and dedupe range

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Change the ocfs2 remap code to allow for returning partial results. Signed-off-by: Darrick J. Wong --- fs/ocfs2/file.c |7 + fs/ocfs2/refcounttree.c | 73 ++- fs/ocfs2/refcounttree.h | 12 3 files

[PATCH 23/25] xfs: fix pagecache truncation prior to reflink

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Prior to remapping blocks, it is necessary to remove pages from the destination file's page cache. Unfortunately, the truncation is not aggressive enough -- if page size > block size, we'll end up zeroing subpage blocks instead of removing them. So, round the start offset

[PATCH 20/25] ocfs2: truncate page cache for clone destination file before remapping

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong When cloning blocks into another file, truncate the page cache before we start remapping blocks so that concurrent reads wait for us to finish. Signed-off-by: Darrick J. Wong --- fs/ocfs2/refcounttree.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-)

[PATCH 21/25] ocfs2: fix pagecache truncation prior to reflink

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Prior to remapping blocks, it is necessary to remove pages from the destination file's page cache. Unfortunately, the truncation is not aggressive enough -- if page size > block size, we'll end up zeroing subpage blocks instead of removing them. So, round the start offset

[PATCH 19/25] vfs: implement opportunistic short dedupe

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong For a given dedupe request, the bytes_deduped field in the control structure tells userspace if we managed to deduplicate some, but not all of, the requested regions starting from the file offsets supplied. However, due to sloppy coding, the current dedupe code returns

[PATCH 18/25] vfs: hide file range comparison function

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong There are no callers of vfs_dedupe_file_range_compare, so we might as well make it a static helper and remove the export. Signed-off-by: Darrick J. Wong Reviewed-by: Amir Goldstein --- fs/read_write.c| 191 ++--

[PATCH 16/25] vfs: make remapping to source file eof more explicit

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Create a RFR_TO_SRC_EOF flag to explicitly declare that the caller wants the remap implementation to remap to the end of the source file, once the files are locked. Signed-off-by: Darrick J. Wong Reviewed-by: Amir Goldstein --- fs/ioctl.c |3 ++-

[PATCH 17/25] vfs: enable remap callers that can handle short operations

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Plumb in a remap flag that enables the filesystem remap handler to shorten remapping requests for callers that can handle it. Now copy_file_range can report partial success (in case we run up against alignment problems, resource limits, etc.). Signed-off-by: Darrick J.

[PATCH 15/25] vfs: plumb RFR_* remap flags through the vfs dedupe functions

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Plumb a remap_flags argument through the vfs_dedupe_file_range_one functions so that dedupe can take advantage of it. Signed-off-by: Darrick J. Wong Reviewed-by: Amir Goldstein --- fs/overlayfs/file.c |3 ++- fs/read_write.c |9 ++--- include/linux/fs.h

[PATCH 12/25] vfs: pass remap flags to generic_remap_checks

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Pass the same remap flags to generic_remap_checks for consistency. Signed-off-by: Darrick J. Wong Reviewed-by: Amir Goldstein --- fs/read_write.c|2 +- include/linux/fs.h |2 +- mm/filemap.c |4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)

[PATCH 13/25] vfs: make remap_file_range functions take and return bytes completed

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Change the remap_file_range functions to take a number of bytes to operate upon and return the number of bytes they operated on. This is a requirement for allowing fs implementations to return short clone/dedupe results to the user, which will enable us to obey resource

[PATCH 14/25] vfs: plumb RFR_* remap flags through the vfs clone functions

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Plumb a remap_flags argument through the {do,vfs}_clone_file_range functions so that clone can take advantage of it. Signed-off-by: Darrick J. Wong Reviewed-by: Amir Goldstein --- fs/ioctl.c |2 +- fs/nfsd/vfs.c |2 +- fs/overlayfs/copy_up.c

[PATCH 09/25] vfs: rename clone_verify_area to remap_verify_area

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Since we use clone_verify_area for both clone and dedupe range checks, rename the function to make it clear that it's for both. Signed-off-by: Darrick J. Wong Reviewed-by: Amir Goldstein --- fs/read_write.c | 10 +- 1 file changed, 5 insertions(+), 5

[PATCH 06/25] vfs: skip zero-length dedupe requests

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Don't bother calling the filesystem for a zero-length dedupe request; we can return zero and exit. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Amir Goldstein --- fs/read_write.c |5 + 1 file changed, 5 insertions(+) diff --git

[PATCH 08/25] vfs: rename vfs_clone_file_prep to be more descriptive

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong The vfs_clone_file_prep is a generic function to be called by filesystem implementations only. Rename the prefix to generic_ and make it more clear that it applies to remap operations, not just clones. Signed-off-by: Darrick J. Wong Reviewed-by: Amir Goldstein ---

[PATCH 07/25] vfs: combine the clone and dedupe into a single remap_file_range

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Combine the clone_file_range and dedupe_file_range operations into a single remap_file_range file operation dispatch since they're fundamentally the same operation. The differences between the two can be made in the prep functions. Signed-off-by: Darrick J. Wong

[PATCH 10/25] vfs: create generic_remap_file_range_touch to update inode metadata

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Create a new VFS helper to handle inode metadata updates when remapping into a file. If the operation can possibly alter the file contents, we must update the ctime and mtime and remove security privileges, just like we do for regular file writes. Wire up ocfs2 to ensure

[PATCH 05/25] vfs: avoid problematic remapping requests into partial EOF block

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong A deduplication data corruption is exposed by fstests generic/505 on XFS. It is caused by extending the block match range to include the partial EOF block, but then allowing unknown data beyond EOF to be considered a "match" to data in the destination file because the

[PATCH 03/25] vfs: check file ranges before cloning files

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Move the file range checks from vfs_clone_file_prep into a separate generic_remap_checks function so that all the checks are collected in a central location. This forms the basis for adding more checks from generic_write_checks that will make cloning's input checking more

[PATCH 02/25] vfs: vfs_clone_file_prep_inodes should return EINVAL for a clone from beyond EOF

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong vfs_clone_file_prep_inodes cannot return 0 if it is asked to remap from a zero byte file because that's what btrfs does. Signed-off-by: Darrick J. Wong --- fs/read_write.c |3 --- 1 file changed, 3 deletions(-) diff --git a/fs/read_write.c b/fs/read_write.c index

[PATCH 04/25] vfs: strengthen checking of file range inputs to generic_remap_checks

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong File range remapping, if allowed to run past the destination file's EOF, is an optimization on a regular file write. Regular file writes that extend the file length are subject to various constraints which are not checked by range cloning. This is a correctness problem

[PATCH v3 00/25] fs: fixes for serious clone/dedupe problems

2018-10-10 Thread Darrick J. Wong
Hi all, Dave, Eric, and I have been chasing a stale data exposure bug in the XFS reflink implementation, and tracked it down to reflink forgetting to do some of the file-extending activities that must happen for regular writes. We then started auditing the clone, dedupe, and copyfile code and

[PATCH 01/25] xfs: add a per-xfs trace_printk macro

2018-10-10 Thread Darrick J. Wong
From: Darrick J. Wong Add a "xfs_tprintk" macro so that developers can use trace_printk to print out arbitrary debugging information with the XFS device name attached to the trace output. Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_error.h |6 ++ 1 file changed, 6 insertions(+)

Re: Scrub aborts due to corrupt leaf

2018-10-10 Thread Chris Murphy
On Wed, Oct 10, 2018 at 9:07 PM, Larkin Lowrey wrote: > On 10/10/2018 10:51 PM, Chris Murphy wrote: >> >> On Wed, Oct 10, 2018 at 8:12 PM, Larkin Lowrey >> wrote: >>> >>> On 10/10/2018 7:55 PM, Hans van Kranenburg wrote: On 10/10/2018 07:44 PM, Chris Murphy wrote: > > > I'm

Re: [PATCH v2 3/9] geneirc/077 fix min size for btrfs

2018-10-10 Thread Anand Jain
On 10/11/2018 11:14 AM, Anand Jain wrote: On 10/06/2018 07:25 PM, Eryu Guan wrote: On Tue, Sep 25, 2018 at 12:24:16PM +0800, Anand Jain wrote: If btrfs need to be tested at its default blockgroup which is non-mixed, then it needs at least 256mb. Signed-off-by: Anand Jain (Sorry for

[PATCH v3] geneirc/077 fix min size for btrfs

2018-10-10 Thread Anand Jain
If btrfs need to be tested at its default blockgroup which is non-mixed, then it needs at least 256mb. Signed-off-by: Anand Jain --- v2->v3: separated from the patch set of 9. notrun for the cases where filler is not big enough to fill the fssize. v2->v1: ref the

Re: [PATCH v2 3/9] geneirc/077 fix min size for btrfs

2018-10-10 Thread Anand Jain
On 10/06/2018 07:25 PM, Eryu Guan wrote: On Tue, Sep 25, 2018 at 12:24:16PM +0800, Anand Jain wrote: If btrfs need to be tested at its default blockgroup which is non-mixed, then it needs at least 256mb. Signed-off-by: Anand Jain (Sorry for the late review..) Its fine. Sorry for the

Re: Scrub aborts due to corrupt leaf

2018-10-10 Thread Larkin Lowrey
On 10/10/2018 10:51 PM, Chris Murphy wrote: On Wed, Oct 10, 2018 at 8:12 PM, Larkin Lowrey wrote: On 10/10/2018 7:55 PM, Hans van Kranenburg wrote: On 10/10/2018 07:44 PM, Chris Murphy wrote: I'm pretty sure you have to umount, and then clear the space_cache with 'btrfs check

Re: Scrub aborts due to corrupt leaf

2018-10-10 Thread Chris Murphy
On Wed, Oct 10, 2018 at 8:12 PM, Larkin Lowrey wrote: > On 10/10/2018 7:55 PM, Hans van Kranenburg wrote: >> >> On 10/10/2018 07:44 PM, Chris Murphy wrote: >>> >>> >>> I'm pretty sure you have to umount, and then clear the space_cache >>> with 'btrfs check --clear-space-cache=v1' and then do a

Re: Recovery options for damaged beginning of the filesystem

2018-10-10 Thread Chris Murphy
On Tue, Oct 9, 2018 at 10:47 PM, Shapranov Vladimir wrote: > Hi, > > I've got a filesystem with first ~50Mb accidentally dd'ed. > > "btrfs check" fails with a following error (regardless of "-s"): > checksum verify failed on 21037056 found FC8A6557 wanted 2F51D090 > checksum verify failed on

Re: [PATCH v2 4/4] btrfs: Refactor find_free_extent() loops update into find_free_extent_update_loop()

2018-10-10 Thread Su Yue
On 8/21/18 4:44 PM, Qu Wenruo wrote: We have a complex loop design for find_free_extent(), that has different behavior for each loop, some even includes new chunk allocation. Instead of putting such a long code into find_free_extent() and makes it harder to read, just extract them into

Re: Scrub aborts due to corrupt leaf

2018-10-10 Thread Larkin Lowrey
On 10/10/2018 7:55 PM, Hans van Kranenburg wrote: On 10/10/2018 07:44 PM, Chris Murphy wrote: I'm pretty sure you have to umount, and then clear the space_cache with 'btrfs check --clear-space-cache=v1' and then do a one time mount with -o space_cache=v2. The --clear-space-cache=v1 is

Re: [PATCH v2 3/4] btrfs: Refactor unclustered extent allocation into find_free_extent_unclustered()

2018-10-10 Thread Su Yue
On 8/21/18 4:44 PM, Qu Wenruo wrote: This patch will extract unclsutered extent allocation code into find_free_extent_unclustered(). And this helper function will use return value to indicate what to do next. This should make find_free_extent() a little easier to read. Signed-off-by: Qu

Re: [PATCH v2 2/4] btrfs: Refactor clustered extent allocation into find_free_extent_clustered()

2018-10-10 Thread Su Yue
On 8/21/18 4:44 PM, Qu Wenruo wrote: We have two main methods to find free extents inside a block group: 1) clustered allocation 2) unclustered allocation This patch will extract the clustered allocation into find_free_extent_clustered() to make it a little easier to read. Instead of

Re: Scrub aborts due to corrupt leaf

2018-10-10 Thread Hans van Kranenburg
On 10/10/2018 07:44 PM, Chris Murphy wrote: > On Wed, Oct 10, 2018 at 10:04 AM, Holger Hoffstätte > wrote: >> On 10/10/18 17:44, Larkin Lowrey wrote: >> (..) >>> >>> About once a week, or so, I'm running into the above situation where >>> FS seems to deadlock. All IO to the FS blocks, there is no

Re: Recovery options for damaged beginning of the filesystem

2018-10-10 Thread Qu Wenruo
On 2018/10/10 下午12:47, Shapranov Vladimir wrote: > Hi, > > I've got a filesystem with first ~50Mb accidentally dd'ed. So about 49M meta/data loss. It depends on the chunk layout. If it got one metadata chunk wiped out, it's pretty hard to repair. If it only wiped several data chunks, it

Re: Scrub aborts due to corrupt leaf

2018-10-10 Thread Qu Wenruo
On 2018/10/11 上午1:25, Larkin Lowrey wrote: > On 10/10/2018 12:04 PM, Holger Hoffstätte wrote: >> On 10/10/18 17:44, Larkin Lowrey wrote: >> (..) >>> About once a week, or so, I'm running into the above situation where >>> FS seems to deadlock. All IO to the FS blocks, there is no IO >>> activity

Re: Scrub aborts due to corrupt leaf

2018-10-10 Thread Chris Murphy
On Wed, Oct 10, 2018 at 12:31 PM, Larkin Lowrey wrote: > Interesting, because I do not see any indications of any other errors. The > fs is backed by an mdraid array and the raid checks always pass with no > mismatches, edac-util doesn't report any ECC errors, smartd doesn't report > any SMART

Re: Scrub aborts due to corrupt leaf

2018-10-10 Thread Larkin Lowrey
On 10/10/2018 2:20 PM, Holger Hoffstätte wrote: On 10/10/18 19:25, Larkin Lowrey wrote: On 10/10/2018 12:04 PM, Holger Hoffstätte wrote: On 10/10/18 17:44, Larkin Lowrey wrote: (..) About once a week, or so, I'm running into the above situation where FS seems to deadlock. All IO to the FS

Re: Scrub aborts due to corrupt leaf

2018-10-10 Thread Holger Hoffstätte
On 10/10/18 19:44, Chris Murphy wrote: On Wed, Oct 10, 2018 at 10:04 AM, Holger Hoffstätte wrote: On 10/10/18 17:44, Larkin Lowrey wrote: (..) About once a week, or so, I'm running into the above situation where FS seems to deadlock. All IO to the FS blocks, there is no IO activity at all. I

Re: Scrub aborts due to corrupt leaf

2018-10-10 Thread Holger Hoffstätte
On 10/10/18 19:25, Larkin Lowrey wrote: On 10/10/2018 12:04 PM, Holger Hoffstätte wrote: On 10/10/18 17:44, Larkin Lowrey wrote: (..) About once a week, or so, I'm running into the above situation where FS seems to deadlock. All IO to the FS blocks, there is no IO activity at all. I have to

Re: Scrub aborts due to corrupt leaf

2018-10-10 Thread Chris Murphy
On Wed, Oct 10, 2018 at 10:04 AM, Holger Hoffstätte wrote: > On 10/10/18 17:44, Larkin Lowrey wrote: > (..) >> >> About once a week, or so, I'm running into the above situation where >> FS seems to deadlock. All IO to the FS blocks, there is no IO >> activity at all. I have to hard reboot the

Re: Scrub aborts due to corrupt leaf

2018-10-10 Thread Larkin Lowrey
On 10/10/2018 12:04 PM, Holger Hoffstätte wrote: On 10/10/18 17:44, Larkin Lowrey wrote: (..) About once a week, or so, I'm running into the above situation where FS seems to deadlock. All IO to the FS blocks, there is no IO activity at all. I have to hard reboot the system to recover. There

Re: Scrub aborts due to corrupt leaf

2018-10-10 Thread Holger Hoffstätte
On 10/10/18 17:44, Larkin Lowrey wrote: (..) About once a week, or so, I'm running into the above situation where FS seems to deadlock. All IO to the FS blocks, there is no IO activity at all. I have to hard reboot the system to recover. There are no error indications except for the following

Re: Scrub aborts due to corrupt leaf

2018-10-10 Thread Larkin Lowrey
On 9/11/2018 11:23 AM, Larkin Lowrey wrote: On 8/29/2018 1:32 AM, Qu Wenruo wrote: On 2018/8/28 下午9:56, Chris Murphy wrote: On Tue, Aug 28, 2018 at 7:42 AM, Qu Wenruo wrote: On 2018/8/28 下午9:29, Larkin Lowrey wrote: On 8/27/2018 10:12 PM, Larkin Lowrey wrote: On 8/27/2018 12:46 AM, Qu

Transaction aborted (error -28) - at fs/btrfs/extent-tree.c:6953

2018-10-10 Thread David Goodwin
I've just hit this on a backup server. I suspect something would have been trying to remove/create a snapshot at the time. I'll ignorantly assume it's similar to the last one I posted ( https://www.spinics.net/lists/linux-btrfs/msg82636.html ) although the trace is different. David.

Re: [PATCH v2 1/4] btrfs: Introduce find_free_extent_ctrl structure for later rework

2018-10-10 Thread Qu Wenruo
On 2018/10/10 下午4:51, Su Yue wrote: > > > On 8/21/18 4:44 PM, Qu Wenruo wrote: >> Instead of tons of different local variables in find_free_extent(), >> extract them into find_free_extent_ctrl structure, and add better >> explanation for them. >> >> Some modification may looks redundant, but

Re: [PATCH v2 1/4] btrfs: Introduce find_free_extent_ctrl structure for later rework

2018-10-10 Thread Su Yue
On 8/21/18 4:44 PM, Qu Wenruo wrote: Instead of tons of different local variables in find_free_extent(), extract them into find_free_extent_ctrl structure, and add better explanation for them. Some modification may looks redundant, but will later greatly simplify function parameter list