[f2fs-dev] [PATCH] f2fs: show compression in statx

2020-03-24 Thread Chao Yu
fstest reports below message when compression is on:

generic/424 1s ... - output mismatch
--- tests/generic/424.out
+++ results/generic/424.out.bad
@@ -1,2 +1,26 @@
 QA output created by 424
+[!] Attribute compressed should be set
+Failed
+stat_test failed
+[!] Attribute compressed should be set
+Failed
+stat_test failed

We missed to set STATX_ATTR_COMPRESSED on compressed inode in getattr(),
fix it.

Signed-off-by: Chao Yu 
---
 fs/f2fs/file.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 1cc6919e1c5e..5c24f2ca3465 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -818,6 +818,8 @@ int f2fs_getattr(const struct path *path, struct kstat 
*stat,
}
 
flags = fi->i_flags;
+   if (flags & F2FS_COMPR_FL)
+   stat->attributes |= STATX_ATTR_COMPRESSED;
if (flags & F2FS_APPEND_FL)
stat->attributes |= STATX_ATTR_APPEND;
if (IS_ENCRYPTED(inode))
@@ -829,7 +831,8 @@ int f2fs_getattr(const struct path *path, struct kstat 
*stat,
if (IS_VERITY(inode))
stat->attributes |= STATX_ATTR_VERITY;
 
-   stat->attributes_mask |= (STATX_ATTR_APPEND |
+   stat->attributes_mask |= (STATX_ATTR_COMPRESSED |
+ STATX_ATTR_APPEND |
  STATX_ATTR_ENCRYPTED |
  STATX_ATTR_IMMUTABLE |
  STATX_ATTR_NODUMP |
-- 
2.18.0.rc1



___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH] f2fs: remove redundant compress inode check

2020-03-24 Thread Chao Yu
On 2020/3/25 10:17, Jaegeuk Kim wrote:
> On 03/25, Chao Yu wrote:
>> On 2020/3/24 23:43, Jaegeuk Kim wrote:
>>> On 03/24, Chao Yu wrote:
 Jaegeuk,

 Missed to apply this patch?

 On 2020/2/29 18:49, Chao Yu wrote:
> due to f2fs_post_read_required() has did that.
>
> Signed-off-by: Chao Yu 
> ---
>  fs/f2fs/f2fs.h | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index f4bcbbd5e9ed..882f9ad3445b 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -4006,8 +4006,6 @@ static inline bool f2fs_force_buffered_io(struct 
> inode *inode,
>   return true;
>   if (f2fs_is_multi_device(sbi))
>   return true;
> - if (f2fs_compressed_file(inode))
> - return true;
>>>
>>> I thought that we can keep this to avoid any confusion when porting to old
>>> production kernel which uses ICE.
>>
>> That old kernel w/ ICE doesn't have f2fs_post_read_required(), right?
> 
> We do have.

Well, so I didn't catch your point why we will confuse. :P

> 
>>
>> I thought we backport features with order of the time fsverity/compression
>> feature was introduced, then f2fs_post_read_required() should be there
>> when we backport compression feature.
>>
>> Thanks,
>>
>>>
>   /*
>* for blkzoned device, fallback direct IO to buffered IO, so
>* all IOs can be serialized by log-structured write.
>
>>> .
>>>
> .
> 


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH] f2fs: remove redundant compress inode check

2020-03-24 Thread Jaegeuk Kim
On 03/25, Chao Yu wrote:
> On 2020/3/24 23:43, Jaegeuk Kim wrote:
> > On 03/24, Chao Yu wrote:
> >> Jaegeuk,
> >>
> >> Missed to apply this patch?
> >>
> >> On 2020/2/29 18:49, Chao Yu wrote:
> >>> due to f2fs_post_read_required() has did that.
> >>>
> >>> Signed-off-by: Chao Yu 
> >>> ---
> >>>  fs/f2fs/f2fs.h | 2 --
> >>>  1 file changed, 2 deletions(-)
> >>>
> >>> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> >>> index f4bcbbd5e9ed..882f9ad3445b 100644
> >>> --- a/fs/f2fs/f2fs.h
> >>> +++ b/fs/f2fs/f2fs.h
> >>> @@ -4006,8 +4006,6 @@ static inline bool f2fs_force_buffered_io(struct 
> >>> inode *inode,
> >>>   return true;
> >>>   if (f2fs_is_multi_device(sbi))
> >>>   return true;
> >>> - if (f2fs_compressed_file(inode))
> >>> - return true;
> > 
> > I thought that we can keep this to avoid any confusion when porting to old
> > production kernel which uses ICE.
> 
> That old kernel w/ ICE doesn't have f2fs_post_read_required(), right?

We do have.

> 
> I thought we backport features with order of the time fsverity/compression
> feature was introduced, then f2fs_post_read_required() should be there
> when we backport compression feature.
> 
> Thanks,
> 
> > 
> >>>   /*
> >>>* for blkzoned device, fallback direct IO to buffered IO, so
> >>>* all IOs can be serialized by log-structured write.
> >>>
> > .
> > 


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH] f2fs: remove redundant compress inode check

2020-03-24 Thread Chao Yu
On 2020/3/24 23:43, Jaegeuk Kim wrote:
> On 03/24, Chao Yu wrote:
>> Jaegeuk,
>>
>> Missed to apply this patch?
>>
>> On 2020/2/29 18:49, Chao Yu wrote:
>>> due to f2fs_post_read_required() has did that.
>>>
>>> Signed-off-by: Chao Yu 
>>> ---
>>>  fs/f2fs/f2fs.h | 2 --
>>>  1 file changed, 2 deletions(-)
>>>
>>> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
>>> index f4bcbbd5e9ed..882f9ad3445b 100644
>>> --- a/fs/f2fs/f2fs.h
>>> +++ b/fs/f2fs/f2fs.h
>>> @@ -4006,8 +4006,6 @@ static inline bool f2fs_force_buffered_io(struct 
>>> inode *inode,
>>> return true;
>>> if (f2fs_is_multi_device(sbi))
>>> return true;
>>> -   if (f2fs_compressed_file(inode))
>>> -   return true;
> 
> I thought that we can keep this to avoid any confusion when porting to old
> production kernel which uses ICE.

That old kernel w/ ICE doesn't have f2fs_post_read_required(), right?

I thought we backport features with order of the time fsverity/compression
feature was introduced, then f2fs_post_read_required() should be there
when we backport compression feature.

Thanks,

> 
>>> /*
>>>  * for blkzoned device, fallback direct IO to buffered IO, so
>>>  * all IOs can be serialized by log-structured write.
>>>
> .
> 


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


[f2fs-dev] Your Fund.

2020-03-24 Thread Mr . Samuel Chukwuyem Okojere
Attention:

In consonance with the Central (Apex) Banks of West African 
countries (BENIN, BURKINA FASO, CAPE VERDE, COTE D'IVOIRE, 
GAMBIA, GHANA, GUINEA, GUINEA BISSAU, LIBERIA, MALI, NIGER, 
NIGERIA, SENEGAL, SIERRA LEONE,TOGO),we are committed to 
identifying beneficiaries/payments for eventual unconditional 
transfer to beneficiaries.

I, respectfully wish to draw your attention to the following that 
you have been identified as a beneficiary of outstanding Fund 
currently long overdue and to help / facilitate our on going 
exercise, preparing to the unconditional transfer of your funds, 
You need to urgently reconfirm your details and requisite 
information viz,

(a) Full names and address and telephone.
(b) Copy of your identity.
(c) Essential documents pertaining to your funds and your claim 
for payment.

Note:   You are quickly advised to stop communication with any 
other person whatsoever.Finally, endeavor to treat this mail as 
imperative and urgent and also to maintain confidentiality on it 
at all times and in all places until you have received your 
funds.

Finally, endeavor to treat this mail as imperative and urgent and 
also to maintain confidentiality on it at all times and in all 
places until you have received your funds.

Sincerely Yours,

Mr. Samuel Chukwuyem Okojere
Director,Payment Systems Management Department
Central Bank of Nigeria
Plot 33,Abubakar Tafawa Balewa Way 
Central Business District,Cadastral Zone,
Abuja,Federal Capital Territory,Nigeria 
P.M.B. 0187,Garki Abuja. 
Nigeria


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH 2/2] writeback, xfs: call dirty_inode() with I_DIRTY_TIME_EXPIRED when appropriate

2020-03-24 Thread Theodore Y. Ts'o
On Tue, Mar 24, 2020 at 01:37:59AM -0700, Christoph Hellwig wrote:
> On Mon, Mar 23, 2020 at 01:58:38PM -0400, Theodore Y. Ts'o wrote:
> > Christoph, Dave --- does this give you the notification that you were
> > looking such that XFS could get the notification desired that it was
> > the timestamps need to be written back?
> 
> I need to look at it in more detail as it seems convoluted.  Also the
> order seems like you regress XFS in patch 1 and then fix it in patch 2?

In patch one we send I_DIRTY_SYNC as we had been doing as before.  So
I don't believe that patch #1 would regress XFS; can you confirm?

My thinking was to move ahead with patch 1 so that it fixed the bug
which Eric Biffers had reported for f2fs, but only to move forward
with patch #2 if it would be useful for XFS.

Cheers,

- Ted


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH] f2fs: remove redundant compress inode check

2020-03-24 Thread Jaegeuk Kim
On 03/24, Chao Yu wrote:
> Jaegeuk,
> 
> Missed to apply this patch?
> 
> On 2020/2/29 18:49, Chao Yu wrote:
> > due to f2fs_post_read_required() has did that.
> > 
> > Signed-off-by: Chao Yu 
> > ---
> >  fs/f2fs/f2fs.h | 2 --
> >  1 file changed, 2 deletions(-)
> > 
> > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> > index f4bcbbd5e9ed..882f9ad3445b 100644
> > --- a/fs/f2fs/f2fs.h
> > +++ b/fs/f2fs/f2fs.h
> > @@ -4006,8 +4006,6 @@ static inline bool f2fs_force_buffered_io(struct 
> > inode *inode,
> > return true;
> > if (f2fs_is_multi_device(sbi))
> > return true;
> > -   if (f2fs_compressed_file(inode))
> > -   return true;

I thought that we can keep this to avoid any confusion when porting to old
production kernel which uses ICE.

> > /*
> >  * for blkzoned device, fallback direct IO to buffered IO, so
> >  * all IOs can be serialized by log-structured write.
> > 


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH v2] f2fs: compress: support zstd compress algorithm

2020-03-24 Thread Jaegeuk Kim
On 03/24, Chao Yu wrote:
> Hi Jaegeuk,
> 
> On 2020/3/3 17:46, Chao Yu wrote:
> > Add zstd compress algorithm support, use "compress_algorithm=zstd"
> > mountoption to enable it.
> > 
> > Signed-off-by: Chao Yu 
> > ---
> > v2:
> > - avoid accessing invalid address
> > - introduce .{init,destroy}_{,de}compress_ctx callback functions.
> 
> I guess we merged related patches with wrong sequence as this patch
> depends on ("f2fs: compress: add .{init,destroy}_decompress_ctx callback").

Done.

> 
> Thanks,


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH v2] f2fs: compress: support zstd compress algorithm

2020-03-24 Thread Chao Yu
Hi Jaegeuk,

On 2020/3/3 17:46, Chao Yu wrote:
> Add zstd compress algorithm support, use "compress_algorithm=zstd"
> mountoption to enable it.
> 
> Signed-off-by: Chao Yu 
> ---
> v2:
> - avoid accessing invalid address
> - introduce .{init,destroy}_{,de}compress_ctx callback functions.

I guess we merged related patches with wrong sequence as this patch
depends on ("f2fs: compress: add .{init,destroy}_decompress_ctx callback").

Thanks,


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH] f2fs: fix long latency due to discard during umount

2020-03-24 Thread Chao Yu
On 2020/3/24 17:08, Chao Yu wrote:
> On 2020/3/18 12:44, Sahitya Tummala wrote:
>> F2FS already has a default timeout of 5 secs for discards that
>> can be issued during umount, but it can take more than the 5 sec
>> timeout if the underlying UFS device queue is already full and there
>> are no more available free tags to be used. In that case, submit_bio()
>> will wait for the already queued discard requests to complete to get
>> a free tag, which can potentially take way more than 5 sec.
>>
>> Fix this by submitting the discard requests with REQ_NOWAIT
>> flags during umount. This will return -EAGAIN for UFS queue/tag full
>> scenario without waiting in the context of submit_bio(). The FS can
>> then handle these requests by retrying again within the stipulated
>> discard timeout period to avoid long latencies.

BTW, I guess later we can add nowait logic as a sub policy of
discard_policy, then DPOLICY_BG would be more configurable with
this nowait policy support.

Thanks,

>>
>> Signed-off-by: Sahitya Tummala 
> 
> Reviewed-by: Chao Yu 
> 
> Thanks,
> 
> 
> ___
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
> .
> 


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH v5] fsck.f2fs: allow fsck to fix issues with online resize due to SPO

2020-03-24 Thread Chao Yu
On 2020/3/24 17:12, Sahitya Tummala wrote:
> Add support for new CP flag CP_RESIZEFS_FLAG set during online
> resize FS. If SPO happens after SB is updated but CP isn't, then
> allow fsck to fix it.
> 
> The fsck errors without this fix -
> Info: CKPT version = 6ed7bccb
> Wrong user_block_count(2233856)
> [f2fs_do_mount:3365] Checkpoint is polluted
> 
> The subsequent mount failure without this fix -
> [   11.294650] F2FS-fs (sda8): Wrong user_block_count: 2233856
> [   11.300272] F2FS-fs (sda8): Failed to get valid F2FS checkpoint
> 
> Signed-off-by: Sahitya Tummala 

Reviewed-by: Chao Yu 

Thanks,


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH v4] fsck.f2fs: allow fsck to fix issues with online resize due to SPO

2020-03-24 Thread Sahitya Tummala
On Tue, Mar 24, 2020 at 02:19:46PM +0800, Chao Yu wrote:
> On 2020/3/23 18:58, Sahitya Tummala wrote:
> > Add support for new CP flag CP_RESIZEFS_FLAG set during online
> > resize FS. If SPO happens after SB is updated but CP isn't, then
> > allow fsck to fix it.
> > 
> > The fsck errors without this fix -
> > Info: CKPT version = 6ed7bccb
> > Wrong user_block_count(2233856)
> > [f2fs_do_mount:3365] Checkpoint is polluted
> > 
> > The subsequent mount failure without this fix -
> > [   11.294650] F2FS-fs (sda8): Wrong user_block_count: 2233856
> > [   11.300272] F2FS-fs (sda8): Failed to get valid F2FS checkpoint
> > 
> > Signed-off-by: Sahitya Tummala 
> > ---
> > v4:
> > - add conditions to allow fix for -a or -p option as well
> > 
> >  fsck/mount.c  | 62 
> > +--
> >  include/f2fs_fs.h |  1 +
> >  2 files changed, 47 insertions(+), 16 deletions(-)
> > 
> > diff --git a/fsck/mount.c b/fsck/mount.c
> > index e4ba048..387957f 100644
> > --- a/fsck/mount.c
> > +++ b/fsck/mount.c
> > @@ -429,6 +429,8 @@ void print_cp_state(u32 flag)
> > MSG(0, "%s", " orphan_inodes");
> > if (flag & CP_DISABLED_FLAG)
> > MSG(0, "%s", " disabled");
> > +   if (flag & CP_RESIZEFS_FLAG)
> > +   MSG(0, "%s", " resizefs");
> > if (flag & CP_UMOUNT_FLAG)
> > MSG(0, "%s", " unmount");
> > else
> > @@ -1123,11 +1125,26 @@ fail_no_cp:
> > return -EINVAL;
> >  }
> >  
> > +static int f2fs_chk_fix_on_state(struct f2fs_super_block *sb, u32 flag)
> > +{
> > +   if (!c.fix_on && (c.auto_fix || c.preen_mode)) {
> > +   if (flag & CP_FSCK_FLAG ||
> > +   flag & CP_QUOTA_NEED_FSCK_FLAG ||
> > +   (exist_qf_ino(sb) && (flag & CP_ERROR_FLAG))) {
> > +   c.fix_on = 1;
> > +   } else if (!c.preen_mode) {
> > +   print_cp_state(flag);
> > +   }
> > +   }
> > +   return c.fix_on;
> > +}
> > +
> >  int sanity_check_ckpt(struct f2fs_sb_info *sbi)
> >  {
> > unsigned int total, fsmeta;
> > struct f2fs_super_block *sb = F2FS_RAW_SUPER(sbi);
> > struct f2fs_checkpoint *cp = F2FS_CKPT(sbi);
> > +   unsigned int flag = get_cp(ckpt_flags);
> > unsigned int ovp_segments, reserved_segments;
> > unsigned int main_segs, blocks_per_seg;
> > unsigned int sit_segs, nat_segs;
> > @@ -1164,8 +1181,31 @@ int sanity_check_ckpt(struct f2fs_sb_info *sbi)
> > log_blocks_per_seg = get_sb(log_blocks_per_seg);
> > if (!user_block_count || user_block_count >=
> > segment_count_main << log_blocks_per_seg) {
> > -   MSG(0, "\tWrong user_block_count(%u)\n", user_block_count);
> > -   return 1;
> > +   ASSERT_MSG("\tWrong user_block_count(%u)\n", user_block_count);
> > +   if (!f2fs_chk_fix_on_state(sb, flag))
> > +   return 1;
> > +
> > +   if (flag & (CP_FSCK_FLAG | CP_RESIZEFS_FLAG)) {
> > +   u32 valid_user_block_cnt;
> > +   u32 seg_cnt_main = get_sb(segment_count) -
> > +   (get_sb(segment_count_ckpt) +
> > +get_sb(segment_count_sit) +
> > +get_sb(segment_count_nat) +
> > +get_sb(segment_count_ssa));
> > +
> > +   /* validate segment_count_main in sb first */
> > +   if (seg_cnt_main != get_sb(segment_count_main)) {
> > +   MSG(0, "Inconsistent segment_cnt_main %u in 
> > sb\n",
> > +   segment_count_main << 
> > log_blocks_per_seg);
> > +   return 1;
> > +   }
> > +   valid_user_block_cnt = ((get_sb(segment_count_main) -
> > +   get_cp(overprov_segment_count)) 
> > * c.blks_per_seg);
> > +   MSG(0, "Info: Fix wrong user_block_count in CP: (%u) -> 
> > (%u)\n",
> > +   user_block_count, valid_user_block_cnt);
> > +   set_cp(user_block_count, valid_user_block_cnt);
> > +   c.bug_on = 1;
> > +   }
> > }
> >  
> > main_segs = get_sb(segment_count_main);
> > @@ -3361,6 +3401,8 @@ int f2fs_do_mount(struct f2fs_sb_info *sbi)
> > return -1;
> > }
> >  
> > +   c.bug_on = 0;
> > +
> > if (sanity_check_ckpt(sbi)) {
> > ERR_MSG("Checkpoint is polluted\n");
> > return -1;
> > @@ -3380,8 +3422,6 @@ int f2fs_do_mount(struct f2fs_sb_info *sbi)
> > c.fix_on = 1;
> > }
> >  
> > -   c.bug_on = 0;
> > -
> > if (tune_sb_features(sbi))
> > return -1;
> >  
> > @@ -3411,18 +3451,8 @@ int f2fs_do_mount(struct f2fs_sb_info *sbi)
> > return -1;
> > }
> >  
> > -   if (!c.fix_on && (c.auto_fix || c.preen_mode)) {
> > 

Re: [f2fs-dev] [PATCH] f2fs: fix long latency due to discard during umount

2020-03-24 Thread Chao Yu
On 2020/3/18 12:44, Sahitya Tummala wrote:
> F2FS already has a default timeout of 5 secs for discards that
> can be issued during umount, but it can take more than the 5 sec
> timeout if the underlying UFS device queue is already full and there
> are no more available free tags to be used. In that case, submit_bio()
> will wait for the already queued discard requests to complete to get
> a free tag, which can potentially take way more than 5 sec.
> 
> Fix this by submitting the discard requests with REQ_NOWAIT
> flags during umount. This will return -EAGAIN for UFS queue/tag full
> scenario without waiting in the context of submit_bio(). The FS can
> then handle these requests by retrying again within the stipulated
> discard timeout period to avoid long latencies.
> 
> Signed-off-by: Sahitya Tummala 

Reviewed-by: Chao Yu 

Thanks,


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH v10 12/25] mm: Move end_index check out of readahead loop

2020-03-24 Thread Christoph Hellwig
On Mon, Mar 23, 2020 at 01:22:46PM -0700, Matthew Wilcox wrote:
> From: "Matthew Wilcox (Oracle)" 
> 
> By reducing nr_to_read, we can eliminate this check from inside the loop.
> 
> Signed-off-by: Matthew Wilcox (Oracle) 
> Reviewed-by: John Hubbard 
> Reviewed-by: William Kucharski 

Looks good,

Reviewed-by: Christoph Hellwig 


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH 2/2] writeback, xfs: call dirty_inode() with I_DIRTY_TIME_EXPIRED when appropriate

2020-03-24 Thread Christoph Hellwig
On Mon, Mar 23, 2020 at 01:58:38PM -0400, Theodore Y. Ts'o wrote:
> Christoph, Dave --- does this give you the notification that you were
> looking such that XFS could get the notification desired that it was
> the timestamps need to be written back?

I need to look at it in more detail as it seems convoluted.  Also the
order seems like you regress XFS in patch 1 and then fix it in patch 2?


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


[f2fs-dev] [Bug 206057] 5.5.0-rc2-next: f2fs is extremely slow, with ext4 system works well

2020-03-24 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=206057

Chao Yu (c...@kernel.org) changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

--- Comment #7 from Chao Yu (c...@kernel.org) ---
Hi David,

Sorry for taking so long time to troubleshoot this issue, finally
we figure out below patch, and it can fix 32bit machine hang issue.

https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/commit/?h=dev-test=e36d8816848a4201420ad318f95b97bc86a58ade

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


[f2fs-dev] [PATCH] f2fs: fix to avoid double unlock

2020-03-24 Thread Chao Yu
On image that has verity and compression feature, if compressed pages
and non-compressed pages are mixed in one bio, we may double unlock
non-compressed page in below flow:

- f2fs_post_read_work
 - f2fs_decompress_work
  - f2fs_decompress_bio
   - __read_end_io
- unlock_page
 - fsverity_enqueue_verify_work
  - f2fs_verity_work
   - f2fs_verify_bio
- unlock_page

So it should skip handling non-compressed page in f2fs_decompress_work()
if verity is on.

Besides, add missing dec_page_count() in f2fs_verify_bio().

Signed-off-by: Chao Yu 
---
 fs/f2fs/data.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 0197b7b80d19..24643680489b 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -139,6 +139,8 @@ static void __read_end_io(struct bio *bio, bool compr, bool 
verity)
f2fs_decompress_pages(bio, page, verity);
continue;
}
+   if (verity)
+   continue;
 #endif
 
/* PG_error was set if any post_read step failed */
@@ -216,6 +218,7 @@ static void f2fs_verify_bio(struct bio *bio)
ClearPageUptodate(page);
ClearPageError(page);
 unlock:
+   dec_page_count(F2FS_P_SB(page), __read_io_type(page));
unlock_page(page);
}
 }
-- 
2.18.0.rc1



___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH v4] fsck.f2fs: allow fsck to fix issues with online resize due to SPO

2020-03-24 Thread Chao Yu
On 2020/3/23 18:58, Sahitya Tummala wrote:
> Add support for new CP flag CP_RESIZEFS_FLAG set during online
> resize FS. If SPO happens after SB is updated but CP isn't, then
> allow fsck to fix it.
> 
> The fsck errors without this fix -
> Info: CKPT version = 6ed7bccb
> Wrong user_block_count(2233856)
> [f2fs_do_mount:3365] Checkpoint is polluted
> 
> The subsequent mount failure without this fix -
> [   11.294650] F2FS-fs (sda8): Wrong user_block_count: 2233856
> [   11.300272] F2FS-fs (sda8): Failed to get valid F2FS checkpoint
> 
> Signed-off-by: Sahitya Tummala 
> ---
> v4:
> - add conditions to allow fix for -a or -p option as well
> 
>  fsck/mount.c  | 62 
> +--
>  include/f2fs_fs.h |  1 +
>  2 files changed, 47 insertions(+), 16 deletions(-)
> 
> diff --git a/fsck/mount.c b/fsck/mount.c
> index e4ba048..387957f 100644
> --- a/fsck/mount.c
> +++ b/fsck/mount.c
> @@ -429,6 +429,8 @@ void print_cp_state(u32 flag)
>   MSG(0, "%s", " orphan_inodes");
>   if (flag & CP_DISABLED_FLAG)
>   MSG(0, "%s", " disabled");
> + if (flag & CP_RESIZEFS_FLAG)
> + MSG(0, "%s", " resizefs");
>   if (flag & CP_UMOUNT_FLAG)
>   MSG(0, "%s", " unmount");
>   else
> @@ -1123,11 +1125,26 @@ fail_no_cp:
>   return -EINVAL;
>  }
>  
> +static int f2fs_chk_fix_on_state(struct f2fs_super_block *sb, u32 flag)
> +{
> + if (!c.fix_on && (c.auto_fix || c.preen_mode)) {
> + if (flag & CP_FSCK_FLAG ||
> + flag & CP_QUOTA_NEED_FSCK_FLAG ||
> + (exist_qf_ino(sb) && (flag & CP_ERROR_FLAG))) {
> + c.fix_on = 1;
> + } else if (!c.preen_mode) {
> + print_cp_state(flag);
> + }
> + }
> + return c.fix_on;
> +}
> +
>  int sanity_check_ckpt(struct f2fs_sb_info *sbi)
>  {
>   unsigned int total, fsmeta;
>   struct f2fs_super_block *sb = F2FS_RAW_SUPER(sbi);
>   struct f2fs_checkpoint *cp = F2FS_CKPT(sbi);
> + unsigned int flag = get_cp(ckpt_flags);
>   unsigned int ovp_segments, reserved_segments;
>   unsigned int main_segs, blocks_per_seg;
>   unsigned int sit_segs, nat_segs;
> @@ -1164,8 +1181,31 @@ int sanity_check_ckpt(struct f2fs_sb_info *sbi)
>   log_blocks_per_seg = get_sb(log_blocks_per_seg);
>   if (!user_block_count || user_block_count >=
>   segment_count_main << log_blocks_per_seg) {
> - MSG(0, "\tWrong user_block_count(%u)\n", user_block_count);
> - return 1;
> + ASSERT_MSG("\tWrong user_block_count(%u)\n", user_block_count);
> + if (!f2fs_chk_fix_on_state(sb, flag))
> + return 1;
> +
> + if (flag & (CP_FSCK_FLAG | CP_RESIZEFS_FLAG)) {
> + u32 valid_user_block_cnt;
> + u32 seg_cnt_main = get_sb(segment_count) -
> + (get_sb(segment_count_ckpt) +
> +  get_sb(segment_count_sit) +
> +  get_sb(segment_count_nat) +
> +  get_sb(segment_count_ssa));
> +
> + /* validate segment_count_main in sb first */
> + if (seg_cnt_main != get_sb(segment_count_main)) {
> + MSG(0, "Inconsistent segment_cnt_main %u in 
> sb\n",
> + segment_count_main << 
> log_blocks_per_seg);
> + return 1;
> + }
> + valid_user_block_cnt = ((get_sb(segment_count_main) -
> + get_cp(overprov_segment_count)) 
> * c.blks_per_seg);
> + MSG(0, "Info: Fix wrong user_block_count in CP: (%u) -> 
> (%u)\n",
> + user_block_count, valid_user_block_cnt);
> + set_cp(user_block_count, valid_user_block_cnt);
> + c.bug_on = 1;
> + }
>   }
>  
>   main_segs = get_sb(segment_count_main);
> @@ -3361,6 +3401,8 @@ int f2fs_do_mount(struct f2fs_sb_info *sbi)
>   return -1;
>   }
>  
> + c.bug_on = 0;
> +
>   if (sanity_check_ckpt(sbi)) {
>   ERR_MSG("Checkpoint is polluted\n");
>   return -1;
> @@ -3380,8 +3422,6 @@ int f2fs_do_mount(struct f2fs_sb_info *sbi)
>   c.fix_on = 1;
>   }
>  
> - c.bug_on = 0;
> -
>   if (tune_sb_features(sbi))
>   return -1;
>  
> @@ -3411,18 +3451,8 @@ int f2fs_do_mount(struct f2fs_sb_info *sbi)
>   return -1;
>   }
>  
> - if (!c.fix_on && (c.auto_fix || c.preen_mode)) {
> - u32 flag = get_cp(ckpt_flags);
> -
> - if (flag & CP_FSCK_FLAG ||
> - flag & CP_QUOTA_NEED_FSCK_FLAG ||
> - 

Re: [f2fs-dev] [PATCH v5] f2fs: fix potential .flags overflow on 32bit architecture

2020-03-24 Thread Chao Yu
On 2020/3/23 23:10, Jaegeuk Kim wrote:
> On 03/23, Joe Perches wrote:
>> On Mon, 2020-03-23 at 11:18 +0800, Chao Yu wrote:
>>> f2fs_inode_info.flags is unsigned long variable, it has 32 bits
>>> in 32bit architecture, since we introduced FI_MMAP_FILE flag
>>> when we support data compression, we may access memory cross
>>> the border of .flags field, corrupting .i_sem field, result in
>>> below deadlock.
>> []
>>> diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
>> []
>>> @@ -362,7 +362,7 @@ static int do_read_inode(struct inode *inode)
>>> fi->i_flags = le32_to_cpu(ri->i_flags);
>>> if (S_ISREG(inode->i_mode))
>>> fi->i_flags &= ~F2FS_PROJINHERIT_FL;
>>> -   fi->flags = 0;
>>> +   bitmap_zero(fi->flags, BITS_TO_LONGS(FI_MAX));
>>
>> Sorry, I misled you here, this should be
>>
>>  bitmap_zero(fi->flags, FI_MAX);

Oh, I missed to check that as well. :(

> 
> Thanks, I applied this directly in the f2fs tree.

Thanks for the help.

Thanks,

> .
> 


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] [PATCH] f2fs: remove redundant compress inode check

2020-03-24 Thread Chao Yu
Jaegeuk,

Missed to apply this patch?

On 2020/2/29 18:49, Chao Yu wrote:
> due to f2fs_post_read_required() has did that.
> 
> Signed-off-by: Chao Yu 
> ---
>  fs/f2fs/f2fs.h | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index f4bcbbd5e9ed..882f9ad3445b 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -4006,8 +4006,6 @@ static inline bool f2fs_force_buffered_io(struct inode 
> *inode,
>   return true;
>   if (f2fs_is_multi_device(sbi))
>   return true;
> - if (f2fs_compressed_file(inode))
> - return true;
>   /*
>* for blkzoned device, fallback direct IO to buffered IO, so
>* all IOs can be serialized by log-structured write.
> 


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel