OCFS2-Devel Archive mirror
 help / color / mirror / Atom feed
From: Heming Zhao via Ocfs2-devel <ocfs2-devel@oss.oracle.com>
To: Joseph Qi <joseph.qi@linux.alibaba.com>, ocfs2-devel@oss.oracle.com
Subject: Re: [Ocfs2-devel] [PATCH] ocfs2: fix non-auto defrag path not	working issue
Date: Mon, 20 Feb 2023 12:28:51 +0800	[thread overview]
Message-ID: <ca674f18-03a7-1b65-ca06-f377e0d6f12f@suse.com> (raw)
In-Reply-To: <650b3d8d-35cb-3385-f9ac-0ad31f9fcdc2@linux.alibaba.com>

On 2/20/23 11:18 AM, Joseph Qi wrote:
> 
> 
> On 2/17/23 9:20 AM, Heming Zhao wrote:
>> This commit fixes three issues on non-auto defrag path (defragfs.ocfs2
>> doesn't set OCFS2_MOVE_EXT_FL_AUTO_DEFRAG on range.me_flags):
>> - For ocfs2_find_victim_alloc_group(), old code forgot enlarge bitmap
>>    range for global_bitmap case. Old code could generate negative
>>    vict_bit.
>> - For ocfs2_probe_alloc_group(), old code forgot back off move_len when
>>    finding enough bitmap space. Old code has possibility to make data
>>    corruption.
>> - For ocfs2_ioctl_move_extents(), this func should set me_threshold for
>>    both auto & non-auto path. Without setting me_threshold,
>>    ocfs2_move_extent() will make 'move_max_hop = 0', then
>>    ocfs2_probe_alloc_group() returns 'phys_cpos == 0' under max_hop is 0.
>>
>> Another info is current defragfs.ocfs2 doesn't have ability to trigger
>> non-auto defrag path. I modified defragfs.ocfs2 source code ".me_flags"
>> and hardcode ".me_goal" for running test.
>>
> 
> I'm fine with the code changes. But the commit log needs improve.
> How about the following?

OK, I will send v2 patch.
Thank you for your review and spent time to revise my commit log.

Thanks,
Heming

> 
> This fixes three issues on move extents ioctl without auto defrag:
> 
> a) In ocfs2_find_victim_alloc_group(), we have to convert bits to block
> first in case of global bitmap.
> b) In ocfs2_probe_alloc_group(), when finding enough bits in block group
> bitmap, we have to back off move_len to start pos as well, otherwise it
> may corrupt filesystem.
> c) In ocfs2_ioctl_move_extents(), set me_threshold both for non-auto and
> auto defrag paths. Otherwise it will set move_max_hop to 0 and finally
> cause unexpectedly ENOSPC error.
> 
> Currently there is no tools triggering the above issues since
> defragfs.ocfs2 enables auto defrag by default. Test with manually
> changing defragfs.ocfs2 to run non auto defrag path.
> 
> Thanks,
> Joseph
> 
> 
>> Signed-off-by: Heming Zhao <heming.zhao@suse.com>
>> ---
>>   fs/ocfs2/move_extents.c | 24 +++++++++++++-----------
>>   1 file changed, 13 insertions(+), 11 deletions(-)
>>


_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

      reply	other threads:[~2023-02-20  4:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-17  1:20 [Ocfs2-devel] [PATCH] ocfs2: fix non-auto defrag path not working issue Heming Zhao via Ocfs2-devel
2023-02-20  3:18 ` Joseph Qi via Ocfs2-devel
2023-02-20  4:28   ` Heming Zhao via Ocfs2-devel [this message]

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=ca674f18-03a7-1b65-ca06-f377e0d6f12f@suse.com \
    --to=ocfs2-devel@oss.oracle.com \
    --cc=heming.zhao@suse.com \
    --cc=joseph.qi@linux.alibaba.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).