From: Jan Kara <jack@suse.cz>
To: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Cc: linux-ext4@vger.kernel.org, Theodore Ts'o <tytso@mit.edu>,
Ritesh Harjani <riteshh@linux.ibm.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Andreas Dilger <adilger.kernel@dilger.ca>,
Jan Kara <jack@suse.cz>, rookxu <brookxu.cn@gmail.com>,
Ritesh Harjani <ritesh.list@gmail.com>
Subject: Re: [RFC v3 1/8] ext4: Stop searching if PA doesn't satisfy non-extent file
Date: Thu, 29 Sep 2022 13:24:54 +0200 [thread overview]
Message-ID: <20220929112454.ribbghdrz3qvyy2b@quack3> (raw)
In-Reply-To: <113e30014fdcf409680e20ec1ef4455ace33884d.1664269665.git.ojaswin@linux.ibm.com>
On Tue 27-09-22 14:46:41, Ojaswin Mujoo wrote:
> If we come across a PA that matches the logical offset but is unable to
> satisfy a non-extent file due to its physical start being higher than
> that supported by non extent files, then simply stop searching for
> another PA and break out of loop. This is because, since PAs don't
> overlap, we won't be able to find another inode PA which can satisfy the
> original request.
>
> Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
> Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/ext4/mballoc.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
> index 71f5b67d7f28..2e3eb632a216 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -4383,8 +4383,13 @@ ext4_mb_use_preallocated(struct ext4_allocation_context *ac)
> /* non-extent files can't have physical blocks past 2^32 */
> if (!(ext4_test_inode_flag(ac->ac_inode, EXT4_INODE_EXTENTS)) &&
> (pa->pa_pstart + EXT4_C2B(sbi, pa->pa_len) >
> - EXT4_MAX_BLOCK_FILE_PHYS))
> - continue;
> + EXT4_MAX_BLOCK_FILE_PHYS)) {
> + /*
> + * Since PAs don't overlap, we won't find any
> + * other PA to satisfy this.
> + */
> + break;
> + }
>
> /* found preallocated blocks, use them */
> spin_lock(&pa->pa_lock);
> --
> 2.31.1
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2022-09-29 11:25 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-27 9:16 [RFC v2 0/8] ext4: Convert inode preallocation list to an rbtree Ojaswin Mujoo
2022-09-27 9:16 ` [RFC v3 1/8] ext4: Stop searching if PA doesn't satisfy non-extent file Ojaswin Mujoo
2022-09-29 11:24 ` Jan Kara [this message]
2022-09-27 9:16 ` [RFC v3 2/8] ext4: Refactor code related to freeing PAs Ojaswin Mujoo
2022-09-29 11:26 ` Jan Kara
2022-09-27 9:16 ` [RFC v3 3/8] ext4: Refactor code in ext4_mb_normalize_request() and ext4_mb_use_preallocated() Ojaswin Mujoo
2022-09-29 11:30 ` Jan Kara
2022-09-27 9:16 ` [RFC v3 4/8] ext4: Move overlap assert logic into a separate function Ojaswin Mujoo
2022-09-29 11:32 ` Jan Kara
2022-09-27 9:16 ` [RFC v3 5/8] ext4: Abstract out overlap fix/check logic in ext4_mb_normalize_request() Ojaswin Mujoo
2022-09-29 11:36 ` Jan Kara
2022-09-27 9:16 ` [RFC v3 6/8] ext4: Convert pa->pa_inode_list and pa->pa_obj_lock into a union Ojaswin Mujoo
2022-09-29 11:40 ` Jan Kara
2022-09-27 9:16 ` [RFC v3 7/8] ext4: Use rbtrees to manage PAs instead of inode i_prealloc_list Ojaswin Mujoo
2022-09-29 12:39 ` Jan Kara
2022-10-03 11:25 ` Ojaswin Mujoo
2022-09-27 9:16 ` [RFC v3 8/8] ext4: Remove the logic to trim inode PAs Ojaswin Mujoo
2022-09-29 12:53 ` Jan Kara
2022-10-06 6:55 ` Ojaswin Mujoo
2022-10-06 8:59 ` Jan Kara
2022-10-06 10:03 ` Ojaswin Mujoo
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=20220929112454.ribbghdrz3qvyy2b@quack3 \
--to=jack@suse.cz \
--cc=adilger.kernel@dilger.ca \
--cc=brookxu.cn@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=ritesh.list@gmail.com \
--cc=riteshh@linux.ibm.com \
--cc=tytso@mit.edu \
/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