2022-09-15 13:48:12

by Ye Bin

[permalink] [raw]
Subject: [PATCH -next 2/2] ext4: adjust fast commit disable judgement order in ext4_fc_track_inode

Judge filesystem if fast commit disabled before test inode's journal mode.

Signed-off-by: Ye Bin <[email protected]>
---
fs/ext4/fast_commit.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
index eadab945b856..9217a588afd1 100644
--- a/fs/ext4/fast_commit.c
+++ b/fs/ext4/fast_commit.c
@@ -577,15 +577,15 @@ void ext4_fc_track_inode(handle_t *handle, struct inode *inode)
if (S_ISDIR(inode->i_mode))
return;

+ if (ext4_fc_disabled(inode->i_sb))
+ return;
+
if (ext4_should_journal_data(inode)) {
ext4_fc_mark_ineligible(inode->i_sb,
EXT4_FC_REASON_INODE_JOURNAL_DATA, handle);
return;
}

- if (ext4_fc_disabled(inode->i_sb))
- return;
-
if (ext4_test_mount_flag(inode->i_sb, EXT4_MF_FC_INELIGIBLE))
return;

--
2.31.1


2022-09-15 14:36:16

by Jan Kara

[permalink] [raw]
Subject: Re: [PATCH -next 2/2] ext4: adjust fast commit disable judgement order in ext4_fc_track_inode

On Thu 15-09-22 21:56:11, Ye Bin wrote:
> Judge filesystem if fast commit disabled before test inode's journal mode.
>
> Signed-off-by: Ye Bin <[email protected]>

Probably makes sense but is there any particular reason why you do this?

Honza

> ---
> fs/ext4/fast_commit.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
> index eadab945b856..9217a588afd1 100644
> --- a/fs/ext4/fast_commit.c
> +++ b/fs/ext4/fast_commit.c
> @@ -577,15 +577,15 @@ void ext4_fc_track_inode(handle_t *handle, struct inode *inode)
> if (S_ISDIR(inode->i_mode))
> return;
>
> + if (ext4_fc_disabled(inode->i_sb))
> + return;
> +
> if (ext4_should_journal_data(inode)) {
> ext4_fc_mark_ineligible(inode->i_sb,
> EXT4_FC_REASON_INODE_JOURNAL_DATA, handle);
> return;
> }
>
> - if (ext4_fc_disabled(inode->i_sb))
> - return;
> -
> if (ext4_test_mount_flag(inode->i_sb, EXT4_MF_FC_INELIGIBLE))
> return;
>
> --
> 2.31.1
>
--
Jan Kara <[email protected]>
SUSE Labs, CR

2022-09-15 14:45:10

by Ye Bin

[permalink] [raw]
Subject: Re: [PATCH -next 2/2] ext4: adjust fast commit disable judgement order in ext4_fc_track_inode



On 2022/9/15 22:30, Jan Kara wrote:
> On Thu 15-09-22 21:56:11, Ye Bin wrote:
>> Judge filesystem if fast commit disabled before test inode's journal mode.
>>
>> Signed-off-by: Ye Bin <[email protected]>
> Probably makes sense but is there any particular reason why you do this?
>
> Honza

I think the impact of fast commit on normal processes should be minimized.

>
>> ---
>> fs/ext4/fast_commit.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
>> index eadab945b856..9217a588afd1 100644
>> --- a/fs/ext4/fast_commit.c
>> +++ b/fs/ext4/fast_commit.c
>> @@ -577,15 +577,15 @@ void ext4_fc_track_inode(handle_t *handle, struct inode *inode)
>> if (S_ISDIR(inode->i_mode))
>> return;
>>
>> + if (ext4_fc_disabled(inode->i_sb))
>> + return;
>> +
>> if (ext4_should_journal_data(inode)) {
>> ext4_fc_mark_ineligible(inode->i_sb,
>> EXT4_FC_REASON_INODE_JOURNAL_DATA, handle);
>> return;
>> }
>>
>> - if (ext4_fc_disabled(inode->i_sb))
>> - return;
>> -
>> if (ext4_test_mount_flag(inode->i_sb, EXT4_MF_FC_INELIGIBLE))
>> return;
>>
>> --
>> 2.31.1
>>

2022-09-15 15:02:56

by Jan Kara

[permalink] [raw]
Subject: Re: [PATCH -next 2/2] ext4: adjust fast commit disable judgement order in ext4_fc_track_inode

On Thu 15-09-22 22:42:58, yebin wrote:
>
>
> On 2022/9/15 22:30, Jan Kara wrote:
> > On Thu 15-09-22 21:56:11, Ye Bin wrote:
> > > Judge filesystem if fast commit disabled before test inode's journal mode.
> > >
> > > Signed-off-by: Ye Bin <[email protected]>
> > Probably makes sense but is there any particular reason why you do this?
> >
> > Honza
>
> I think the impact of fast commit on normal processes should be minimized.

Yeah, I guess you mean when fastcommit is actually disabled. Makes sense
but please add it to the changelog. With that feel free to add:

Reviewed-by: Jan Kara <[email protected]>

Honza


>
> >
> > > ---
> > > fs/ext4/fast_commit.c | 6 +++---
> > > 1 file changed, 3 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
> > > index eadab945b856..9217a588afd1 100644
> > > --- a/fs/ext4/fast_commit.c
> > > +++ b/fs/ext4/fast_commit.c
> > > @@ -577,15 +577,15 @@ void ext4_fc_track_inode(handle_t *handle, struct inode *inode)
> > > if (S_ISDIR(inode->i_mode))
> > > return;
> > > + if (ext4_fc_disabled(inode->i_sb))
> > > + return;
> > > +
> > > if (ext4_should_journal_data(inode)) {
> > > ext4_fc_mark_ineligible(inode->i_sb,
> > > EXT4_FC_REASON_INODE_JOURNAL_DATA, handle);
> > > return;
> > > }
> > > - if (ext4_fc_disabled(inode->i_sb))
> > > - return;
> > > -
> > > if (ext4_test_mount_flag(inode->i_sb, EXT4_MF_FC_INELIGIBLE))
> > > return;
> > > --
> > > 2.31.1
> > >
>
--
Jan Kara <[email protected]>
SUSE Labs, CR