[f2fs-dev] [PATCH v4 1/2] dump.f2fs: Add ability to dump folders

2024-05-23 Thread Daniel Rosenberg via Linux-f2fs-devel
This adds the ability to dump folders as well as files. Folders are dumped recursively. Additionally, dumped files/folders may be directed to a folder specified by -o [path] instead of ./lost_found. The -r flag will dump the entire fs from the root inode. -f or -y will skip the prompt before

[f2fs-dev] [PATCH v4 2/2] dump.f2fs: Fix xattr dumping

2024-05-23 Thread Daniel Rosenberg via Linux-f2fs-devel
Xattrs for files with inline data were being skipped. This dumps those, as well as xattrs for folders. Signed-off-by: Daniel Rosenberg Reviewed-by: Daeho Jeong --- fsck/dump.c | 39 +++ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git

[f2fs-dev] [PATCH v3 2/2] dump.f2fs: Fix xattr dumping

2024-05-23 Thread Daniel Rosenberg via Linux-f2fs-devel
Xattrs for files with inline data were being skipped. This dumps those, as well as xattrs for folders. Signed-off-by: Daniel Rosenberg Reviewed-by: Daeho Jeong --- fsck/dump.c | 39 +++ 1 file changed, 27 insertions(+), 12 deletions(-) diff --git

[f2fs-dev] [PATCH v3 1/2] dump.f2fs: Add ability to dump folders

2024-05-23 Thread Daniel Rosenberg via Linux-f2fs-devel
This adds the ability to dump folders as well as files. Folders are dumped recursively. Additionally, dumped files/folders may be directed to a folder specified by -o [path] instead of ./lost_found. The -r flag will dump the entire fs from the root inode. -f or -y will skip the prompt before

[f2fs-dev] [PATCH v2 2/2] dump.f2fs: Fix xattr dumping

2024-05-20 Thread Daniel Rosenberg via Linux-f2fs-devel
Xattrs for files with inline data were being skipped. This dumps those, as well as xattrs for folders. Signed-off-by: Daniel Rosenberg --- fsck/dump.c | 25 + 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/fsck/dump.c b/fsck/dump.c index aecc293..17680d9

[f2fs-dev] [PATCH v2 1/2] dump.f2fs: Add ability to dump folders

2024-05-20 Thread Daniel Rosenberg via Linux-f2fs-devel
This adds the ability to dump folders as well as files. Folders are dumped recursively. Additionally, dumped files/folders may be directed to a folder specified by -o [path] instead of ./lost_found. The -r flag will dump the entire fs from the root inode. -f or -y will skip the prompt before

[f2fs-dev] [PATCH 1/2] dump.f2fs: Add ability to dump folders

2024-05-07 Thread Daniel Rosenberg via Linux-f2fs-devel
This adds the ability to dump folders as well as files. Folders are dumped recursively. Additionally, dumped files/folders may be directed to a folder specified by -o [path] instead of ./lost_found. The -r flag will dump the entire fs from the root inode. -f or -y will skip the prompt before

[f2fs-dev] [PATCH 2/2] dump.f2fs: Fix xattr dumping

2024-05-07 Thread Daniel Rosenberg via Linux-f2fs-devel
Xattrs for files with inline data were being skipped. This dumps those, as well as xattrs for folders. Signed-off-by: Daniel Rosenberg --- fsck/dump.c | 25 + 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/fsck/dump.c b/fsck/dump.c index f60f6f9..3bd17e3

[f2fs-dev] [PATCH 1/2] libf2fs: Accept Sparse files with non 4K Blocksize

2024-01-26 Thread Daniel Rosenberg via Linux-f2fs-devel
Since we may not know the block size when initializing sparse files, we should assume that the sparse file's blocksize is correct. Signed-off-by: Daniel Rosenberg --- fsck/mount.c | 20 +--- lib/libf2fs_io.c | 11 +++ 2 files changed, 20 insertions(+), 11

[f2fs-dev] [PATCH 2/2] libf2fs: Fix possible memleak with Sparse Files

2024-01-26 Thread Daniel Rosenberg via Linux-f2fs-devel
If sparse files is set along with multiple devices, we initialize sparse file data multiple times without freeing the previously allocated data. This skips the initialization for subsequent devices, as sparse file mode currently only deals with device 0 anyways. Signed-off-by: Daniel Rosenberg

[f2fs-dev] [PATCH v3] f2fs: Restrict max filesize for 16K f2fs

2023-12-04 Thread Daniel Rosenberg via Linux-f2fs-devel
Blocks are tracked by u32, so the max permitted filesize is (U32_MAX + 1) * BLOCK_SIZE. Additionally, in order to support crypto data unit sizes of 4K with a 16K block with IV_INO_LBLK_{32,64}, we must further restrict max filesize to (U32_MAX + 1) * 4096. This does not affect 4K blocksize f2fs as

[f2fs-dev] [PATCH v2] f2fs: Restrict max filesize for 16K f2fs

2023-12-04 Thread Daniel Rosenberg via Linux-f2fs-devel
Blocks are tracked by u32, so the max permitted filesize is U32_MAX * BLOCK_SIZE. Additionally, in order to support crypto data unit sizes of 4K with a 16K block size with IV_INO_LBLK_{32,63}, we must further restrict max filesize to U32_MAX * 4096. This does not affect 4K blocksize f2fs as the

[f2fs-dev] [PATCH] f2fs: Restrict max filesize for 16K f2fs

2023-12-01 Thread Daniel Rosenberg via Linux-f2fs-devel
Blocks are tracked by u32, so the max permitted filesize is U32_MAX * BLOCK_SIZE. Additionally, in order to support crypto block sizes of 4K with a 16K block size, we must further restrict max filesize to U32_MAX * 4096. This does not affect 4K blocksize f2fs as the natural limits for those are

[f2fs-dev] [PATCH] man: Add description for mkfs -b option

2023-12-01 Thread Daniel Rosenberg via Linux-f2fs-devel
Describes the block size option -b. This sets the block size, which is restricted to powers of 2. The linux kernel currently requires that the block size be equal to the page size to mount. Change-Id: I27ec4f909f8d27327b48373f0a4a4e8593626804 Signed-off-by: Daniel Rosenberg --- man/mkfs.f2fs.8

[f2fs-dev] [PATCH] man: Add description for mkfs -b option

2023-11-30 Thread Daniel Rosenberg via Linux-f2fs-devel
Describes the block size option -b. This sets the block size, which is restricted to powers of 2. The linux kernel currently requires that the block size be equal to the page size to mount. Change-Id: I27ec4f909f8d27327b48373f0a4a4e8593626804 Signed-off-by: Daniel Rosenberg --- man/mkfs.f2fs.8

Re: [f2fs-dev] [PATCH 2/3] f2fs-tools: Wait for Block Size to initialize Cache

2023-11-27 Thread Daniel Rosenberg via Linux-f2fs-devel
On Sun, Nov 26, 2023 at 5:42 PM Chao Yu wrote: > > Hi Daniel, > > How about this? It be more explicit to indicate the logic? > > --- > fsck/mount.c | 2 ++ > include/f2fs_fs.h | 3 +++ > lib/libf2fs_io.c | 4 > 3 files changed, 9 insertions(+) > > diff --git a/fsck/mount.c

[f2fs-dev] [PATCH 3/3] f2fs-tools: Fix dqb_curspace to reflect blocksize

2023-11-17 Thread Daniel Rosenberg via Linux-f2fs-devel
The initial sizes for dqblk.dqb_curspace should reflect the block size, as that's the minimal filesize. Signed-off-by: Daniel Rosenberg --- mkfs/f2fs_format.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c index f2840c8..b46bc15

[f2fs-dev] [PATCH 0/3] F2FS Tools 16K Bug Fixes

2023-11-17 Thread Daniel Rosenberg via Linux-f2fs-devel
I missed a couple things in my previous patch set. This fixes Quotas, the -c cache option, and a debug print. The issues can be seen by running: truncate test.dat --size 256M make_f2fs -g android -O project_quota,extra_attr -w 16384 -b 16384 test.dat 16384 fsck.f2fs -f -c 1 --debug-cache

[f2fs-dev] [PATCH 1/3] f2fs-tools: Fix debug size print

2023-11-17 Thread Daniel Rosenberg via Linux-f2fs-devel
The conversion from block size to MB in this debug statement assumes a block size of 4K. This switches it to properly use the filesystem's block size. Signed-off-by: Daniel Rosenberg --- fsck/fsck.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fsck/fsck.c b/fsck/fsck.c

[f2fs-dev] [PATCH 2/3] f2fs-tools: Wait for Block Size to initialize Cache

2023-11-17 Thread Daniel Rosenberg via Linux-f2fs-devel
The cache is initialized during the first read, however, it requires the block size to establish its buffer. This disables the cache until the block size is known. Signed-off-by: Daniel Rosenberg --- fsck/mount.c | 5 + 1 file changed, 5 insertions(+) diff --git a/fsck/mount.c

[f2fs-dev] [PATCH v2 1/1] f2fs: Support Block Size == Page Size

2023-10-02 Thread Daniel Rosenberg via Linux-f2fs-devel
This allows f2fs to support cases where the block size = page size for both 4K and 16K block sizes. Other sizes should work as well, should the need arise. This does not currently support 4K Block size filesystems if the page size is 16K. Signed-off-by: Daniel Rosenberg --- fs/f2fs/data.c

[f2fs-dev] [PATCH v2 0/1] Add 16K Support for f2fs

2023-10-02 Thread Daniel Rosenberg via Linux-f2fs-devel
F2fs filesystems currently have two large restrictions around block size. The block size must equal the page size, and the block size must be 4096. The following patch, along with the associated f2fs-tools patch set, relax the latter restriction, allowing you to use 16K block size f2fs on a 16K

[f2fs-dev] [PATCH v3 6/7] f2fs-tools: Refactor f2fs_dentry_block struct

2023-08-28 Thread Daniel Rosenberg via Linux-f2fs-devel
This moves access to f2fs_dentry_block's dentry list and filename list behind a macro, as their locations depend on block size. Since struct f2fs_dentry_block no longer represents the full block, use F2FS_BLKSIZE instead of sizeof(struct f2fs_dentry_block) Signed-off-by: Daniel Rosenberg ---

[f2fs-dev] [PATCH v3 4/7] f2fs-tools: Refactor SIT/NAT block structs

2023-08-28 Thread Daniel Rosenberg via Linux-f2fs-devel
This converts f2fs_nat_block and f2fs_sit_block to be variable length arrays. This does not change the way they are accessed, but removes a misleading statment that these sizes are fixed, as opposed to deriving from F2FS_BLKSIZE Signed-off-by: Daniel Rosenberg --- include/f2fs_fs.h | 20

[f2fs-dev] [PATCH v3 3/7] f2fs-tools: Refactor f2fs_node struct and friends

2023-08-28 Thread Daniel Rosenberg via Linux-f2fs-devel
This converts inodes, direct nodes, and indirect nodes over to not being based on a 4K page size. f2fs_inode's i_nids field should now be accessed via a macro, as it's location depends on block size. Access to direct nodes and indirect nodes is unchanged. The node footer's location is also based

[f2fs-dev] [PATCH v3 0/7] Add 16K Support for f2fs-tools

2023-08-28 Thread Daniel Rosenberg via Linux-f2fs-devel
This adds support for different block sizes to f2fs-tools. The first patch redefines all block size based constants to be based on the block size. After this patch, you should be able to compile a version of f2fs-tools that works for a given blocksize by just setting F2FS_BLKSIZE_BITS in

[f2fs-dev] [PATCH v3 5/7] f2fs-tools: Refactor Summary block struct and friends

2023-08-28 Thread Daniel Rosenberg via Linux-f2fs-devel
This splits off access to the summary block's journal and footer into a macro call, as their location is dependent on block size. Because of this you should use F2FS_BLKSIZE instead of sizeof(struct summary_block) Signed-off-by: Daniel Rosenberg --- fsck/f2fs.h| 4 +-- fsck/fsck.c

[f2fs-dev] [PATCH v3 2/7] f2fs-tools: Refactor Orphan Block struct

2023-08-28 Thread Daniel Rosenberg via Linux-f2fs-devel
This splits off access to the orphan block's footer into a macro call as its location is dependent on block size. Because of this, you should use F2FS_BLKSIZE instead of sizeof(struct f2fs_orphan_block) Signed-off-by: Daniel Rosenberg --- fsck/fsck.c | 4 ++-- fsck/main.c

[f2fs-dev] [PATCH v3 1/7] f2fs-tools: Define constants in terms of BLKSIZE

2023-08-28 Thread Daniel Rosenberg via Linux-f2fs-devel
This converts the various block size based constants to be defined in terms of the block size. This makes it possible to change the block size by changing only F2FS_BLKSIZE_BITS in f2fs_fs.h Signed-off-by: Daniel Rosenberg --- fsck/dir.c | 2 +- fsck/dump.c | 4 +-

[f2fs-dev] [PATCH v3 7/7] f2fs-tools: Support different block sizes

2023-08-28 Thread Daniel Rosenberg via Linux-f2fs-devel
This adds support for 4K and 16K block size using the same binary. mkfs can choose block size via the -b option, with other tools getting the blocksize from the superblock. On mount time, we can't rely on block size for the location for the superblock, since that information is in the superblock.

Re: [f2fs-dev] [PATCH v2 7/7] f2fs-tools: Support different block sizes

2023-08-28 Thread Daniel Rosenberg via Linux-f2fs-devel
On Mon, Aug 28, 2023 at 1:27 PM Jaegeuk Kim wrote: > > This patch somehow reveals struct size assertions. > You can get it when running fsck from the used f2fs partition. > Seems the binary I was testing had the asserts set to noops. I was missing the 2 bytes from n_nats/n_sits, and had a few

Re: [f2fs-dev] [PATCH v2 5/7] f2fs-tools: Refactor Summary block struct and friends

2023-08-28 Thread Daniel Rosenberg via Linux-f2fs-devel
On Mon, Aug 28, 2023 at 11:08 AM Jaegeuk Kim wrote: > > Hi Daniel, > > Could you please check this? > > mount.c: In function ‘move_one_curseg_info’: > mount.c:3037:9: warning: ‘memcpy’ offset [0, 3583] is out of the bounds [0, > 0] of object ‘buf’ with type ‘struct f2fs_summary_block’

[f2fs-dev] [PATCH v2 3/7] f2fs-tools: Refactor f2fs_node struct and friends

2023-08-25 Thread Daniel Rosenberg via Linux-f2fs-devel
This converts inodes, direct nodes, and indirect nodes over to not being based on a 4K page size. f2fs_inode's i_nids field should now be accessed via a macro, as it's location depends on block size. Access to direct nodes and indirect nodes is unchanged. The node footer's location is also based

[f2fs-dev] [PATCH v2 5/7] f2fs-tools: Refactor Summary block struct and friends

2023-08-25 Thread Daniel Rosenberg via Linux-f2fs-devel
This splits off access to the summary block's journal and footer into a macro call, as their location is dependent on block size. Because of this you should use F2FS_BLKSIZE instead of sizeof(struct summary_block) Signed-off-by: Daniel Rosenberg --- fsck/f2fs.h| 4 +-- fsck/fsck.c

[f2fs-dev] [PATCH v2 7/7] f2fs-tools: Support different block sizes

2023-08-25 Thread Daniel Rosenberg via Linux-f2fs-devel
This adds support for 4K and 16K block size using the same binary. mkfs can choose block size via the -b option, with other tools getting the blocksize from the superblock. On mount time, we can't rely on block size for the location for the superblock, since that information is in the superblock.

[f2fs-dev] [PATCH v2 1/7] f2fs-tools: Define constants in terms of BLKSIZE

2023-08-25 Thread Daniel Rosenberg via Linux-f2fs-devel
This converts the various block size based constants to be defined in terms of the block size. This makes it possible to change the block size by changing only F2FS_BLKSIZE_BITS in f2fs_fs.h Signed-off-by: Daniel Rosenberg --- fsck/dir.c | 2 +- fsck/dump.c | 4 +-

Re: [f2fs-dev] [PATCH 1/7] f2fs-tools: Define constants in terms of BLKSIZE

2023-08-25 Thread Daniel Rosenberg via Linux-f2fs-devel
On Fri, Aug 25, 2023 at 10:39 AM Jaegeuk Kim wrote: > > Hi Daniel, > > f2fs_format_main.c: In function ‘add_default_options’: > f2fs_format_main.c:142:41: error: ‘struct f2fs_configuration’ has no member > named ‘blksize’ > 142 | c.wanted_sector_size = c.blksize; > |

[f2fs-dev] [PATCH v2 6/7] f2fs-tools: Refactor f2fs_dentry_block struct

2023-08-25 Thread Daniel Rosenberg via Linux-f2fs-devel
This moves access to f2fs_dentry_block's dentry list and filename list behind a macro, as their locations depend on block size. Since struct f2fs_dentry_block no longer represents the full block, use F2FS_BLKSIZE instead of sizeof(struct f2fs_dentry_block) Signed-off-by: Daniel Rosenberg ---

[f2fs-dev] [PATCH v2 2/7] f2fs-tools: Refactor Orphan Block struct

2023-08-25 Thread Daniel Rosenberg via Linux-f2fs-devel
This splits off access to the orphan block's footer into a macro call as its location is dependent on block size. Because of this, you should use F2FS_BLKSIZE instead of sizeof(struct f2fs_orphan_block) Signed-off-by: Daniel Rosenberg --- fsck/fsck.c | 4 ++-- fsck/main.c | 1 +

[f2fs-dev] [PATCH v2 4/7] f2fs-tools: Refactor SIT/NAT block structs

2023-08-25 Thread Daniel Rosenberg via Linux-f2fs-devel
This converts f2fs_nat_block and f2fs_sit_block to be variable length arrays. This does not change the way they are accessed, but removes a misleading statment that these sizes are fixed, as opposed to deriving from F2FS_BLKSIZE Signed-off-by: Daniel Rosenberg --- include/f2fs_fs.h | 20

[f2fs-dev] [PATCH v2 0/7] Add 16K Support for f2fs-tools

2023-08-25 Thread Daniel Rosenberg via Linux-f2fs-devel
This adds support for different block sizes to f2fs-tools. The first patch redefines all block size based constants to be based on the block size. After this patch, you should be able to compile a version of f2fs-tools that works for a given blocksize by just setting F2FS_BLKSIZE_BITS in

[f2fs-dev] [PATCH 7/7] f2fs-tools: Support different block sizes

2023-08-15 Thread Daniel Rosenberg via Linux-f2fs-devel
This adds support for 4K and 16K block size using the same binary. mkfs can choose block size via the -b option, with other tools getting the blocksize from the superblock. On mount time, we can't rely on block size for the location for the superblock, since that information is in the superblock.

[f2fs-dev] [PATCH 0/7] Add 16K Support for f2fs-tools

2023-08-15 Thread Daniel Rosenberg via Linux-f2fs-devel
This adds support for different block sizes to f2fs-tools. The first patch redefines all block size based constants to be based on the block size. After this patch, you should be able to compile a version of f2fs-tools that works for a given blocksize by just setting F2FS_BLKSIZE_BITS in

[f2fs-dev] [PATCH 6/7] f2fs-tools: Refactor f2fs_dentry_block struct

2023-08-15 Thread Daniel Rosenberg via Linux-f2fs-devel
This moves access to f2fs_dentry_block's dentry list and filename list behind a macro, as their locations depend on block size. Since struct f2fs_dentry_block no longer represents the full block, use F2FS_BLKSIZE instead of sizeof(struct f2fs_dentry_block) Signed-off-by: Daniel Rosenberg ---

[f2fs-dev] [PATCH 1/1] ANDROID: f2fs: Support Block Size == Page Size

2023-08-15 Thread Daniel Rosenberg via Linux-f2fs-devel
This allows f2fs to support cases where the block size = page size for both 4K and 16K block sizes. Other sizes should work as well, should the need arise. This does not currently support 4K Block size filesystems if the page size is 16K. Signed-off-by: Daniel Rosenberg --- fs/f2fs/data.c

[f2fs-dev] [PATCH 0/1] Add 16K Support for f2fs

2023-08-15 Thread Daniel Rosenberg via Linux-f2fs-devel
F2fs filesystems currently have two large restrictions around block size. The block size must equal the page size, and the block size must be 4096. The following patch, along with the associated f2fs-tools patch set, relax the latter restriction, allowing you to use 16K block size f2fs on a 16K

[f2fs-dev] [PATCH 5/7] f2fs-tools: Refactor Summary block struct and friends

2023-08-15 Thread Daniel Rosenberg via Linux-f2fs-devel
This splits off access to the summary block's journal and footer into a macro call, as their location is dependent on block size. Because of this you should use F2FS_BLKSIZE instead of sizeof(struct summary_block) Signed-off-by: Daniel Rosenberg --- fsck/f2fs.h| 4 +-- fsck/fsck.c

[f2fs-dev] [PATCH 2/7] f2fs-tools: Refactor Orphan Block struct

2023-08-15 Thread Daniel Rosenberg via Linux-f2fs-devel
This splits off access to the orphan block's footer into a macro call as its location is dependent on block size. Because of this, you should use F2FS_BLKSIZE instead of sizeof(struct f2fs_orphan_block) Signed-off-by: Daniel Rosenberg --- fsck/fsck.c | 4 ++-- fsck/main.c | 1 +

[f2fs-dev] [PATCH 4/7] f2fs-tools: Refactor SIT/NAT block structs

2023-08-15 Thread Daniel Rosenberg via Linux-f2fs-devel
This converts f2fs_nat_block and f2fs_sit_block to be variable length arrays. This does not change the way they are accessed, but removes a misleading statment that these sizes are fixed, as opposed to deriving from F2FS_BLKSIZE Signed-off-by: Daniel Rosenberg --- include/f2fs_fs.h | 20

[f2fs-dev] [PATCH 1/7] f2fs-tools: Define constants in terms of BLKSIZE

2023-08-15 Thread Daniel Rosenberg via Linux-f2fs-devel
This converts the various block size based constants to be defined in terms of the block size. This makes it possible to change the block size by changing only F2FS_BLKSIZE_BITS in f2fs_fs.h Signed-off-by: Daniel Rosenberg --- fsck/fsck.h | 2 +- fsck/mount.c| 4 +-

[f2fs-dev] [PATCH 3/7] f2fs-tools: Refactor f2fs_node struct and friends

2023-08-15 Thread Daniel Rosenberg via Linux-f2fs-devel
This converts inodes, direct nodes, and indirect nodes over to not being based on a 4K page size. f2fs_inode's i_nids field should now be accessed via a macro, as it's location depends on block size. Access to direct nodes and indirect nodes is unchanged. The node footer's location is also based

Re: [f2fs-dev] [PATCH 0/7] Support negative dentries on case-insensitive directories

2023-02-24 Thread Daniel Rosenberg via Linux-f2fs-devel
These look good to me. It will be nice to have negative dentries back for casefolded directories. -Daniel Rosenberg ___ 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 2/2] f2fs: Advertise encrypted casefolding in sysfs

2021-06-03 Thread Daniel Rosenberg via Linux-f2fs-devel
On Thu, Jun 3, 2021 at 10:38 PM Jaegeuk Kim wrote: > > On 06/03, Eric Biggers wrote: > > On Thu, Jun 03, 2021 at 09:45:25PM -0700, Jaegeuk Kim wrote: > > > On 06/03, Eric Biggers wrote: > > > > On Thu, Jun 03, 2021 at 09:50:38AM +, Daniel Rosenberg wrote: > > > > > Older kernels don't support

[f2fs-dev] [PATCH v2 1/2] f2fs: Show casefolding support only when supported

2021-06-03 Thread Daniel Rosenberg via Linux-f2fs-devel
The casefolding feature is only supported when CONFIG_UNICODE is set. This modifies the feature list f2fs presents under sysfs accordingly. Fixes: 5aba54302a46 ("f2fs: include charset encoding information in the superblock") Cc: sta...@vger.kernel.org # v5.4+ Signed-off-by: Daniel Rosenberg ---

[f2fs-dev] [PATCH v2 2/2] f2fs: Advertise encrypted casefolding in sysfs

2021-06-03 Thread Daniel Rosenberg via Linux-f2fs-devel
Older kernels don't support encryption with casefolding. This adds the sysfs entry encrypted_casefold to show support for those combined features. Support for this feature was originally added by commit 7ad08a58bf67 ("f2fs: Handle casefolding with Encryption") Fixes: 7ad08a58bf67 ("f2fs: Handle

[f2fs-dev] [PATCH v2 0/2] Fix up casefolding sysfs entries for F2FS

2021-06-03 Thread Daniel Rosenberg via Linux-f2fs-devel
These correct displaying support for casefolding only when that capability is present, and advertise if encryption and casefolding are supported together. Casefolding requires CONFIG_UNICODE, and casefolding with encryption wasn't supported until commit 7ad08a58bf67 ("f2fs: Handle casefolding with

Re: [f2fs-dev] [PATCH 2/2] f2fs: Advertise encrypted casefolding in sysfs

2021-06-02 Thread Daniel Rosenberg via Linux-f2fs-devel
On Wed, Jun 2, 2021 at 12:54 PM Eric Biggers wrote: > > On Wed, Jun 02, 2021 at 04:15:39AM +, Daniel Rosenberg wrote: > > +#ifdef CONFIG_UNICODE > > +F2FS_FEATURE_RO_ATTR(encrypted_casefold, FEAT_ENCRYPTED_CASEFOLD); > > +#endif > > Shouldn't it be defined(CONFIG_UNICODE) &&

[f2fs-dev] [PATCH 1/2] f2fs: Show casefolding support only when supported

2021-06-01 Thread Daniel Rosenberg via Linux-f2fs-devel
The casefolding feature is only supported when CONFIG_UNICODE is set. This modifies the feature list f2fs presents under sysfs accordingly. Fixes: 5aba54302a46 ("f2fs: include charset encoding information in the superblock") Signed-off-by: Daniel Rosenberg --- fs/f2fs/sysfs.c | 4 1 file

[f2fs-dev] [PATCH 2/2] f2fs: Advertise encrypted casefolding in sysfs

2021-06-01 Thread Daniel Rosenberg via Linux-f2fs-devel
Older kernels don't support encryption with casefolding. This adds the sysfs entry encrypted_casefold to show support for those combined features. Support for this feature was originally added by commit 7ad08a58bf67 ("f2fs: Handle casefolding with Encryption") Signed-off-by: Daniel Rosenberg ---

[f2fs-dev] [PATCH 0/2] Fix up casefolding sysfs entries for F2FS

2021-06-01 Thread Daniel Rosenberg via Linux-f2fs-devel
These correct displaying support for casefolding only when that capability is present, and advertise if encryption and casefolding are supported together. Casefolding requires CONFIG_UNICODE, and casefolding with encryption wasn't supported until commit 7ad08a58bf67 ("f2fs: Handle casefolding with

Re: [f2fs-dev] [PATCH v4 2/3] fscrypt: Have filesystems handle their d_ops

2020-11-25 Thread Daniel Rosenberg via Linux-f2fs-devel
> > This change has the side-effect of removing the capability of the root > directory from being case-insensitive. It is not a backward > incompatible change because there is no way to make the root directory > CI at the moment (it is never empty). But this restriction seems > artificial. Is

[f2fs-dev] [PATCH v4 1/3] libfs: Add generic function for setting dentry_ops

2020-11-18 Thread Daniel Rosenberg via Linux-f2fs-devel
This adds a function to set dentry operations at lookup time that will work for both encrypted filenames and casefolded filenames. A filesystem that supports both features simultaneously can use this function during lookup preparations to set up its dentry operations once fscrypt no longer does

[f2fs-dev] [PATCH v4 0/3] Add support for Encryption and Casefolding in F2FS

2020-11-18 Thread Daniel Rosenberg via Linux-f2fs-devel
These patches are on top of the torvalds tree. F2FS currently supports casefolding and encryption, but not at the same time. These patches aim to rectify that. In a later follow up, this will be added for Ext4 as well. The f2fs-tools changes have already been applied. Since both fscrypt and

[f2fs-dev] [PATCH v4 2/3] fscrypt: Have filesystems handle their d_ops

2020-11-18 Thread Daniel Rosenberg via Linux-f2fs-devel
This shifts the responsibility of setting up dentry operations from fscrypt to the individual filesystems, allowing them to have their own operations while still setting fscrypt's d_revalidate as appropriate. Most filesystems can just use generic_set_encrypted_ci_d_ops, unless they have their own

[f2fs-dev] [PATCH v4 3/3] f2fs: Handle casefolding with Encryption

2020-11-18 Thread Daniel Rosenberg via Linux-f2fs-devel
Expand f2fs's casefolding support to include encrypted directories. To index casefolded+encrypted directories, we use the SipHash of the casefolded name, keyed by a key derived from the directory's fscrypt master key. This ensures that the dirhash doesn't leak information about the plaintext

[f2fs-dev] [PATCH v3 3/3] f2fs: Handle casefolding with Encryption

2020-11-18 Thread Daniel Rosenberg via Linux-f2fs-devel
Expand f2fs's casefolding support to include encrypted directories. To index casefolded+encrypted directories, we use the SipHash of the casefolded name, keyed by a key derived from the directory's fscrypt master key. This ensures that the dirhash doesn't leak information about the plaintext

[f2fs-dev] [PATCH v3 2/3] fscrypt: Have filesystems handle their d_ops

2020-11-17 Thread Daniel Rosenberg via Linux-f2fs-devel
This shifts the responsibility of setting up dentry operations from fscrypt to the individual filesystems, allowing them to have their own operations while still setting fscrypt's d_revalidate as appropriate. Most filesystems can just use generic_set_encrypted_ci_d_ops, unless they have their own

[f2fs-dev] [PATCH v3 1/3] libfs: Add generic function for setting dentry_ops

2020-11-17 Thread Daniel Rosenberg via Linux-f2fs-devel
This adds a function to set dentry operations at lookup time that will work for both encrypted filenames and casefolded filenames. A filesystem that supports both features simultaneously can use this function during lookup preparations to set up its dentry operations once fscrypt no longer does

[f2fs-dev] [PATCH v3 0/3] Add support for Encryption and Casefolding in F2FS

2020-11-17 Thread Daniel Rosenberg via Linux-f2fs-devel
These patches are on top of the torvalds tree. F2FS currently supports casefolding and encryption, but not at the same time. These patches aim to rectify that. In a later follow up, this will be added for Ext4 as well. The f2fs-tools changes have already been applied. Since both fscrypt and

Re: [f2fs-dev] [PATCH v2 3/3] f2fs: Handle casefolding with Encryption

2020-11-17 Thread Daniel Rosenberg via Linux-f2fs-devel
On Tue, Nov 17, 2020 at 10:50 AM Eric Biggers wrote: > > > What is the assignment to dentry_page supposed to be accomplishing? It looks > like it's meant to pass up errors from f2fs_find_target_dentry(), but it > doesn't > do that. Woops. Fixed that for the next version. > > > @@ -222,14

[f2fs-dev] [PATCH v2 0/3] Add support for Encryption and Casefolding in F2FS

2020-11-16 Thread Daniel Rosenberg via Linux-f2fs-devel
These patches are on top of the torvalds tree. F2FS currently supports casefolding and encryption, but not at the same time. These patches aim to rectify that. In a later follow up, this will be added for Ext4 as well. I've included one ext4 patch from the previous set since it isn't in the f2fs

[f2fs-dev] [PATCH v2 2/3] fscrypt: Have filesystems handle their d_ops

2020-11-16 Thread Daniel Rosenberg via Linux-f2fs-devel
This shifts the responsibility of setting up dentry operations from fscrypt to the individual filesystems, allowing them to have their own operations while still setting fscrypt's d_revalidate as appropriate. Most filesystems can just use generic_set_encrypted_ci_d_ops, unless they have their own

[f2fs-dev] [PATCH v2 3/3] f2fs: Handle casefolding with Encryption

2020-11-16 Thread Daniel Rosenberg via Linux-f2fs-devel
Expand f2fs's casefolding support to include encrypted directories. To index casefolded+encrypted directories, we use the SipHash of the casefolded name, keyed by a key derived from the directory's fscrypt master key. This ensures that the dirhash doesn't leak information about the plaintext

[f2fs-dev] [PATCH v2 1/3] libfs: Add generic function for setting dentry_ops

2020-11-16 Thread Daniel Rosenberg via Linux-f2fs-devel
This adds a function to set dentry operations at lookup time that will work for both encrypted filenames and casefolded filenames. A filesystem that supports both features simultaneously can use this function during lookup preparations to set up its dentry operations once fscrypt no longer does

[f2fs-dev] [PATCH 3/5] libfs: Add generic function for setting dentry_ops

2020-09-22 Thread Daniel Rosenberg via Linux-f2fs-devel
This adds a function to set dentry operations at lookup time that will work for both encrypted files and casefolded filenames. A filesystem that supports both features simultaneously can use this function during lookup preperations to set up its dentry operations once fscrypt no longer does that

[f2fs-dev] [PATCH 0/5] Add support for Encryption and Casefolding in F2FS

2020-09-22 Thread Daniel Rosenberg via Linux-f2fs-devel
These patches are on top of the f2fs dev branch F2FS currently supports casefolding and encryption, but not at the same time. These patches aim to rectify that. In a later follow up, this will be added for Ext4 as well. I've included one ext4 patch from the previous set since it isn't in the f2fs

[f2fs-dev] [PATCH 5/5] f2fs: Handle casefolding with Encryption

2020-09-22 Thread Daniel Rosenberg via Linux-f2fs-devel
Expand f2fs's casefolding support to include encrypted directories. To index casefolded+encrypted directories, we use the SipHash of the casefolded name, keyed by a key derived from the directory's fscrypt master key. This ensures that the dirhash doesn't leak information about the plaintext

[f2fs-dev] [PATCH 2/5] fscrypt: Export fscrypt_d_revalidate

2020-09-22 Thread Daniel Rosenberg via Linux-f2fs-devel
This is in preparation for shifting the responsibility of setting the dentry_operations to the filesystem, allowing it to maintain its own operations. Signed-off-by: Daniel Rosenberg --- fs/crypto/fname.c | 3 ++- include/linux/fscrypt.h | 1 + 2 files changed, 3 insertions(+), 1

[f2fs-dev] [PATCH 1/5] ext4: Use generic casefolding support

2020-09-22 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 4/5] fscrypt: Have filesystems handle their d_ops

2020-09-22 Thread Daniel Rosenberg via Linux-f2fs-devel
This shifts the responsibility of setting up dentry operations from fscrypt to the individual filesystems, allowing them to have their own operations while still setting fscrypt's d_revalidate as appropriate. Most filesystems can just use generic_set_encrypted_ci_d_ops, unless they have their own

[f2fs-dev] [PATCH 0/5] Add support for Encryption and Casefolding in F2FS

2020-09-22 Thread Daniel Rosenberg via Linux-f2fs-devel
These patches are on top of the f2fs dev branch F2FS currently supports casefolding and encryption, but not at the same time. These patches aim to rectify that. In a later follow up, this will be added for Ext4 as well. I've included one ext4 patch from the previous set since it isn't in the f2fs

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

2020-09-22 Thread Daniel Rosenberg via Linux-f2fs-devel
On Mon, Sep 21, 2020 at 11:29 AM Eric Biggers wrote: > > On Sun, Sep 20, 2020 at 09:10:57PM -0400, Gabriel Krisman Bertazi wrote: > > Daniel Rosenberg writes: > > > > > This switches ext4 over to the generic support provided in > > > the previous patch. > > > > > > Since casefolded dentries

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

2020-07-08 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 v12 0/4] Prepare for upcoming Casefolding/Encryption patches

2020-07-08 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

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

2020-07-08 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

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

2020-07-08 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

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

2020-07-08 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

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

2020-07-08 Thread Daniel Rosenberg via Linux-f2fs-devel
On Tue, Jul 7, 2020 at 9:12 PM Eric Biggers wrote: > > 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 > > + *

[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

[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

[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

[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

[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

[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

[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 ---

[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 ---

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 =

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

2020-07-02 Thread Daniel Rosenberg via Linux-f2fs-devel
On Tue, Jun 23, 2020 at 10:57 PM Eric Biggers wrote: > > Note that the '!IS_ENCRYPTED(dir) || fscrypt_has_encryption_key(dir)' check > can > be racy, because a process can be looking up a no-key token in a directory > while > concurrently another process initializes the directory's

  1   2   >