[f2fs-dev] [PATCH] fsck.f2fs: Split build_segment_manager() to speed up auto-fix

2020-07-07 Thread Jaegeuk Kim
From: Robin Hsu Speed up fsck in auto-fix mode by splitting build_segment_manager() into two disjoint parts: early_build_segment_manager(), and late_build_segment_manager(), where in some cases (when !need_fsync_data_record(), or cannot find_fsync_inode()), late_build_segment_mana

Re: [f2fs-dev] [PATCH v11 2/4] fs: Add standard casefolding support

2020-07-07 Thread Eric Biggers
On Tue, Jul 07, 2020 at 08:05:50PM -0700, Daniel Rosenberg wrote: > +/** > + * generic_ci_d_compare - generic d_compare implementation for casefolding > filesystems > + * @dentry: dentry whose name we are checking against > + * @len: len of name of dentry > + * @str: str pointer to name o

[f2fs-dev] [PATCH v5] f2fs: add F2FS_IOC_SEC_TRIM_FILE ioctl

2020-07-07 Thread Daeho Jeong
From: Daeho Jeong Added a new ioctl to send discard commands or/and zero out to selected data area of a regular file for security reason. Signed-off-by: Daeho Jeong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- fs/f2fs/f2fs.h | 15 fs/f2fs/file.c | 181 +++

[f2fs-dev] [PATCH v11 2/4] fs: Add standard casefolding support

2020-07-07 Thread Daniel Rosenberg via Linux-f2fs-devel
This adds general supporting functions for filesystems that use utf8 casefolding. It provides standard dentry_operations and adds the necessary structures in struct super_block to allow this standardization. The new dentry operations are functionally equivalent to the existing operations in ext4 a

[f2fs-dev] [PATCH v11 0/4] Prepare for upcoming Casefolding/Encryption patches

2020-07-07 Thread Daniel Rosenberg via Linux-f2fs-devel
This lays the ground work for enabling casefolding and encryption at the same time for ext4 and f2fs. A future set of patches will enable that functionality. These unify the highly similar dentry_operations that ext4 and f2fs both use for casefolding. In addition, they improve d_hash by not requir

[f2fs-dev] [PATCH v11 4/4] ext4: Use generic casefolding support

2020-07-07 Thread Daniel Rosenberg via Linux-f2fs-devel
This switches ext4 over to the generic support provided in the previous patch. Since casefolded dentries behave the same in ext4 and f2fs, we decrease the maintenance burden by unifying them, and any optimizations will immediately apply to both. Signed-off-by: Daniel Rosenberg Reviewed-by: Eric

[f2fs-dev] [PATCH v11 3/4] f2fs: Use generic casefolding support

2020-07-07 Thread Daniel Rosenberg via Linux-f2fs-devel
This switches f2fs over to the generic support provided in the previous patch. Since casefolded dentries behave the same in ext4 and f2fs, we decrease the maintenance burden by unifying them, and any optimizations will immediately apply to both. Signed-off-by: Daniel Rosenberg Reviewed-by: Eric

[f2fs-dev] [PATCH v11 1/4] unicode: Add utf8_casefold_hash

2020-07-07 Thread Daniel Rosenberg via Linux-f2fs-devel
This adds a case insensitive hash function to allow taking the hash without needing to allocate a casefolded copy of the string. The existing d_hash implementations for casefolding allocate memory within rcu-walk, by avoiding it we can be more efficient and avoid worrying about a failed allocation

Re: [f2fs-dev] [PATCH 1/2] f2fs: support zone capacity less than zone size

2020-07-07 Thread Chao Yu
On 2020/7/8 2:23, Aravind Ramesh wrote: > Thanks for review Chao Yu. > Please find my response inline. > I will re-send a V2 after incorporating your comments. > > Regards, > Aravind > >> -Original Message- >> From: Chao Yu >> Sent: Tuesday, July 7, 2020 5:49 PM >> To: Aravind Ramesh ; j

Re: [f2fs-dev] [PATCH v4] f2fs: add F2FS_IOC_SEC_TRIM_FILE ioctl

2020-07-07 Thread Eric Biggers
Hi Daeho, On Thu, Jun 18, 2020 at 09:51:52PM +0900, Daeho Jeong wrote: > +static int f2fs_sec_trim_file(struct file *filp, unsigned long arg) > +{ > + struct inode *inode = file_inode(filp); > + struct f2fs_sb_info *sbi = F2FS_I_SB(inode); > + struct address_space *mapping = inode->i_m

Re: [f2fs-dev] [PATCH v10 4/4] ext4: Use generic casefolding support

2020-07-07 Thread Eric Biggers
On Tue, Jul 07, 2020 at 04:31:23AM -0700, Daniel Rosenberg wrote: > This switches ext4 over to the generic support provided in > the previous patch. > > Since casefolded dentries behave the same in ext4 and f2fs, we decrease > the maintenance burden by unifying them, and any optimizations will > i

Re: [f2fs-dev] [PATCH v10 3/4] f2fs: Use generic casefolding support

2020-07-07 Thread Eric Biggers
On Tue, Jul 07, 2020 at 04:31:22AM -0700, Daniel Rosenberg wrote: > This switches f2fs over to the generic support provided in > the previous patch. > > Since casefolded dentries behave the same in ext4 and f2fs, we decrease > the maintenance burden by unifying them, and any optimizations will > i

Re: [f2fs-dev] [PATCH v10 1/4] unicode: Add utf8_casefold_hash

2020-07-07 Thread Eric Biggers
On Tue, Jul 07, 2020 at 04:31:20AM -0700, Daniel Rosenberg wrote: > This adds a case insensitive hash function to allow taking the hash > without needing to allocate a casefolded copy of the string. > > The existing d_hash implementations for casefolding allocates memory > within rcu-walk, by avoi

Re: [f2fs-dev] [PATCH v10 2/4] fs: Add standard casefolding support

2020-07-07 Thread Eric Biggers
On Tue, Jul 07, 2020 at 04:31:21AM -0700, Daniel Rosenberg wrote: > +/* > + * Determine if the name of a dentry should be casefolded. It does not make > + * sense to casefold the no-key token of an encrypted filename. > + * > + * Return: if names will need casefolding > + */ > +static bool needs_ca

Re: [f2fs-dev] [PATCH 1/2] f2fs: support zone capacity less than zone size

2020-07-07 Thread Aravind Ramesh
Thanks for review Chao Yu. Please find my response inline. I will re-send a V2 after incorporating your comments. Regards, Aravind > -Original Message- > From: Chao Yu > Sent: Tuesday, July 7, 2020 5:49 PM > To: Aravind Ramesh ; jaeg...@kernel.org; linux- > fsde...@vger.kernel.org; linux

Re: [f2fs-dev] [PATCH v4 0/4] Inline Encryption Support for fscrypt

2020-07-07 Thread Eric Biggers
On Thu, Jul 02, 2020 at 01:56:03AM +, Satya Tangirala wrote: > This patch series adds support for Inline Encryption to fscrypt, f2fs > and ext4. It builds on the inline encryption support now present in > the block layer, and has been rebased on v5.8-rc3. Note that Patches 1 and > 2 can be appl

Re: [f2fs-dev] [PATCH v10 1/4] unicode: Add utf8_casefold_hash

2020-07-07 Thread Gabriel Krisman Bertazi
Daniel Rosenberg writes: > This adds a case insensitive hash function to allow taking the hash > without needing to allocate a casefolded copy of the string. > > The existing d_hash implementations for casefolding allocates memory > within rcu-walk, by avoiding it we can be more efficient and avo

Re: [f2fs-dev] [PATCH 1/2] f2fs: support zone capacity less than zone size

2020-07-07 Thread Chao Yu
On 2020/7/2 23:54, Aravind Ramesh wrote: > NVMe Zoned Namespace devices can have zone-capacity less than zone-size. > Zone-capacity indicates the maximum number of sectors that are usable in > a zone beginning from the first sector of the zone. This makes the sectors > sectors after the zone-capaci

[f2fs-dev] [PATCH v10 2/4] fs: Add standard casefolding support

2020-07-07 Thread Daniel Rosenberg via Linux-f2fs-devel
This adds general supporting functions for filesystems that use utf8 casefolding. It provides standard dentry_operations and adds the necessary structures in struct super_block to allow this standardization. The new dentry operations are functionally equivalent to the existing operations in ext4 a

[f2fs-dev] [PATCH v10 1/4] unicode: Add utf8_casefold_hash

2020-07-07 Thread Daniel Rosenberg via Linux-f2fs-devel
This adds a case insensitive hash function to allow taking the hash without needing to allocate a casefolded copy of the string. The existing d_hash implementations for casefolding allocates memory within rcu-walk, by avoiding it we can be more efficient and avoid worrying about a failed allocatio

[f2fs-dev] [PATCH v10 0/4] Prepare for upcoming Casefolding/Encryption patches

2020-07-07 Thread Daniel Rosenberg via Linux-f2fs-devel
This lays the ground work for enabling casefolding and encryption at the same time for ext4 and f2fs. A future set of patches will enable that functionality. These unify the highly similar dentry_operations that ext4 and f2fs both use for casefolding. In addition, they improve d_hash by not requir

[f2fs-dev] [PATCH v10 3/4] f2fs: Use generic casefolding support

2020-07-07 Thread Daniel Rosenberg via Linux-f2fs-devel
This switches f2fs over to the generic support provided in the previous patch. Since casefolded dentries behave the same in ext4 and f2fs, we decrease the maintenance burden by unifying them, and any optimizations will immediately apply to both. Signed-off-by: Daniel Rosenberg --- fs/f2fs/dir.c

[f2fs-dev] [PATCH v10 4/4] ext4: Use generic casefolding support

2020-07-07 Thread Daniel Rosenberg via Linux-f2fs-devel
This switches ext4 over to the generic support provided in the previous patch. Since casefolded dentries behave the same in ext4 and f2fs, we decrease the maintenance burden by unifying them, and any optimizations will immediately apply to both. Signed-off-by: Daniel Rosenberg --- fs/ext4/dir.c

[f2fs-dev] [PATCH 4/5] f2fs: support 64-bits key in f2fs rb-tree node entry

2020-07-07 Thread Chao Yu
then, we can add specified entry into rb-tree with 64-bits segment time as key. Signed-off-by: Chao Yu --- fs/f2fs/extent_cache.c | 37 +++-- fs/f2fs/f2fs.h | 15 --- fs/f2fs/segment.c | 4 ++-- 3 files changed, 49 insertions(+), 7 deleti

[f2fs-dev] [PATCH 1/5] f2fs: introduce inmem curseg

2020-07-07 Thread Chao Yu
Previous implementation of aligned pinfile allocation will: - allocate new segment on cold data log no matter whether last used segment is partially used or not, it makes IOs more random; - force concurrent cold data/GCed IO going into warm data area, it can make a bad effect on hot/cold data separ

[f2fs-dev] [PATCH 0/5] Support Age-Threshold based Garbage Collection for f2fs

2020-07-07 Thread Chao Yu
This patch series introduce a new garbage collection algorithm named ATGC (Age Threshold based Garbage Collection) in order to enhance efficiency and effect of background garbage collection. ATGC algorithm tries to fliter few oldest candidates according to defined age threshold, it selects source

[f2fs-dev] [PATCH 2/5] f2fs: record average update time of segment

2020-07-07 Thread Chao Yu
Previously, once we update one block in segment, we will update mtime of segment to last time, making aged segment becoming freshest, result in that GC with cost benefit algorithm missing such segment, So this patch changes to record mtime as average block updating time instead of last updating tim

[f2fs-dev] [PATCH 5/5] f2fs: support age threshold based garbage collection

2020-07-07 Thread Chao Yu
There are several issues in current background GC algorithm: - valid blocks is one of key factors during cost overhead calculation, so if segment has less valid block, however even its age is young or it locates hot segment, CB algorithm will still choose the segment as victim, it's not appropriate

[f2fs-dev] [PATCH 3/5] f2fs: inherit mtime of original block during GC

2020-07-07 Thread Chao Yu
Don't let f2fs inner GC ruins original aging degree of segment. Signed-off-by: Chao Yu --- fs/f2fs/data.c| 2 +- fs/f2fs/f2fs.h| 5 +++-- fs/f2fs/gc.c | 4 ++-- fs/f2fs/segment.c | 55 --- 4 files changed, 49 insertions(+), 17 deletions

Re: [f2fs-dev] [PATCH v9 4/4] ext4: Use generic casefolding support

2020-07-07 Thread Daniel Rosenberg via Linux-f2fs-devel
On Tue, Jun 23, 2020 at 10:43 PM Gabriel Krisman Bertazi wrote: > > Daniel Rosenberg writes: > > > - > > const struct dentry_operations ext4_dentry_ops = { > > - .d_hash = ext4_d_hash, > > - .d_compare = ext4_d_compare, > > + .d_hash = generic_ci_d_hash, > > + .d_compare = generi