[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

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

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

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

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

[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_fs.h

[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 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_fs.h

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

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

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

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

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’ [-Warray-bo

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 nat/

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

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

[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 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 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_fs.h

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

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

[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 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 b/fsck/mount.

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

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

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

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 b/fsck/m

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

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

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

[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 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 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 deletions(-)

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

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

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

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

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

[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 a/fsck/dump

[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 a/fsck/dump

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

[f2fs-dev] [PATCH] dump.f2fs: Fix dumping inlined files

2024-06-17 Thread Daniel Rosenberg via Linux-f2fs-devel
The code for dumping files was ignoring i_extra_isize, leading to invalid data for some inlined files after dumping. This swaps inode dumping to use the common inline_data_addr function. Signed-off-by: Daniel Rosenberg --- fsck/dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -

[f2fs-dev] [PATCH] dump.f2fs: Add help description for -rfyPo

2024-06-18 Thread Daniel Rosenberg via Linux-f2fs-devel
These were described in man pages, but not within the help message. Signed-off-by: Daniel Rosenberg --- fsck/main.c | 5 + 1 file changed, 5 insertions(+) diff --git a/fsck/main.c b/fsck/main.c index 6edc902..901fa7a 100644 --- a/fsck/main.c +++ b/fsck/main.c @@ -97,6 +97,11 @@ void dump_us

Re: [f2fs-dev] [PATCH] dump.f2fs: Add help description for -rfyPo

2024-06-18 Thread Daniel Rosenberg via Linux-f2fs-devel
On Tue, Jun 18, 2024 at 6:30 PM Chao Yu wrote: > > On 2024/6/19 9:25, Daniel Rosenberg wrote: > > These were described in man pages, but not within the help message. > > > > Signed-off-by: Daniel Rosenberg > > Can you please check below patch? > > https://git.kernel.org/pub/scm/linux/kernel/git/j

[f2fs-dev] [PATCH] dump.f2fs: Dump symlinks as symlinks

2024-07-15 Thread Daniel Rosenberg via Linux-f2fs-devel
Previously, dumped symlinks would always create regular files instead. This allows symlinks to be dumped as symlinks with the -L option. The i_name field's name may not be the same as the actual name from the dirent, so we use the dirent name when available. Currently hardlinks aren't detected, s

[f2fs-dev] [PATCH v2] dump.f2fs: Dump symlinks as symlinks

2024-07-17 Thread Daniel Rosenberg via Linux-f2fs-devel
Previously, dumped symlinks would always create regular files instead. This allows symlinks to be dumped as symlinks with the -L option. The i_name field's name may not be the same as the actual name from the dirent, so we use the dirent name when available. Currently hardlinks aren't detected, s

[f2fs-dev] [PATCH v3] dump.f2fs: Dump symlinks as symlinks

2024-07-23 Thread Daniel Rosenberg via Linux-f2fs-devel
Previously, dumped symlinks would always create regular files instead. This allows symlinks to be dumped as symlinks with the -L option. The i_name field's name may not be the same as the actual name from the dirent, so we use the dirent name when available. Currently hardlinks aren't detected, s

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

[f2fs-dev] [PATCH 1/2] f2fs: include charset encoding information in the superblock

2019-07-11 Thread Daniel Rosenberg via Linux-f2fs-devel
Add charset encoding to f2fs to support casefolding. It is modeled after the same feature introduced in commit c83ad55eaa91 ("ext4: include charset encoding information in the superblock") Currently this is not compatible with encryption, similar to the current ext4 imlpementation. This will chang

[f2fs-dev] [PATCH 2/2] f2fs: Support case-insensitive file name lookups

2019-07-11 Thread Daniel Rosenberg via Linux-f2fs-devel
Modeled after commit b886ee3e778e ("ext4: Support case-insensitive file name lookups") """ This patch implements the actual support for case-insensitive file name lookups in f2fs, based on the feature bit and the encoding stored in the superblock. A filesystem that has the casefold feature set is

[f2fs-dev] [PATCH v2 2/2] f2fs: Support case-insensitive file name lookups

2019-07-16 Thread Daniel Rosenberg via Linux-f2fs-devel
Modeled after commit b886ee3e778e ("ext4: Support case-insensitive file name lookups") """ This patch implements the actual support for case-insensitive file name lookups in f2fs, based on the feature bit and the encoding stored in the superblock. A filesystem that has the casefold feature set is

[f2fs-dev] [PATCH v2 1/2] f2fs: include charset encoding information in the superblock

2019-07-16 Thread Daniel Rosenberg via Linux-f2fs-devel
Add charset encoding to f2fs to support casefolding. It is modeled after the same feature introduced in commit c83ad55eaa91 ("ext4: include charset encoding information in the superblock") Currently this is not compatible with encryption, similar to the current ext4 imlpementation. This will chang

[f2fs-dev] [PATCH v2 0/2] Casefolding in F2FS

2019-07-16 Thread Daniel Rosenberg via Linux-f2fs-devel
These patches are largely based on the casefolding patches for ext4 v2: Rebased patches again master, changed f2fs_msg to f2fs_info/f2fs_err Daniel Rosenberg (2): f2fs: include charset encoding information in the superblock f2fs: Support case-insensitive file name lookups fs/f2fs/dir.c

Re: [f2fs-dev] [PATCH v2 2/2] f2fs: Support case-insensitive file name lookups

2019-07-18 Thread Daniel Rosenberg via Linux-f2fs-devel
On 7/17/19 3:11 AM, Chao Yu wrote: We need to add one more entry f2fs_fsflags_map[] to map F2FS_CASEFOLD_FL to FS_CASEFOLD_FL correctly and adapt F2FS_GETTABLE_FS_FL/F2FS_SETTABLE_FS_FL as well. I don't see FS_CASEFOLD_FL. It would make sense for it to exist, but unless it's in some recent

[f2fs-dev] [PATCH v3 1/2] f2fs: include charset encoding information in the superblock

2019-07-18 Thread Daniel Rosenberg via Linux-f2fs-devel
Add charset encoding to f2fs to support casefolding. It is modeled after the same feature introduced in commit c83ad55eaa91 ("ext4: include charset encoding information in the superblock") Currently this is not compatible with encryption, similar to the current ext4 imlpementation. This will chang

[f2fs-dev] [PATCH v3 2/2] f2fs: Support case-insensitive file name lookups

2019-07-18 Thread Daniel Rosenberg via Linux-f2fs-devel
Modeled after commit b886ee3e778e ("ext4: Support case-insensitive file name lookups") """ This patch implements the actual support for case-insensitive file name lookups in f2fs, based on the feature bit and the encoding stored in the superblock. A filesystem that has the casefold feature set is

[f2fs-dev] [PATCH v3 0/2] Casefolding in F2FS

2019-07-18 Thread Daniel Rosenberg via Linux-f2fs-devel
These patches are largely based on the casefolding patches for ext4 v3: Addressed feedback, apart from F2FS_CASEFOLD_FL/FS_CASEFOLD_FL Added sysfs file "encoding" to see the encoding set on a filesystem v2: Rebased patches again master, changed f2fs_msg to f2fs_info/f2fs_err Daniel Rosenberg

[f2fs-dev] [PATCH v4 0/3] Casefolding in F2FS

2019-07-23 Thread Daniel Rosenberg via Linux-f2fs-devel
These patches are largely based on the casefolding patches for ext4 v4: Added FS_CASEFOLD_FL flag, added documentation that escaped the last format-patch, moved setting dentry ops to f2fs_setup_casefold v3: Addressed feedback, apart from F2FS_CASEFOLD_FL/FS_CASEFOLD_FL Added sysfs file "en

[f2fs-dev] [PATCH v4 3/3] f2fs: Support case-insensitive file name lookups

2019-07-23 Thread Daniel Rosenberg via Linux-f2fs-devel
Modeled after commit b886ee3e778e ("ext4: Support case-insensitive file name lookups") """ This patch implements the actual support for case-insensitive file name lookups in f2fs, based on the feature bit and the encoding stored in the superblock. A filesystem that has the casefold feature set is

[f2fs-dev] [PATCH v4 1/3] fs: Reserve flag for casefolding

2019-07-23 Thread Daniel Rosenberg via Linux-f2fs-devel
In preparation for including the casefold feature within f2fs, elevate the EXT4_CASEFOLD_FL flag to FS_CASEFOLD_FL. Signed-off-by: Daniel Rosenberg --- include/uapi/linux/fs.h | 1 + tools/include/uapi/linux/fs.h | 1 + 2 files changed, 2 insertions(+) diff --git a/include/uapi/linux/fs.h

[f2fs-dev] [PATCH v4 2/3] f2fs: include charset encoding information in the superblock

2019-07-23 Thread Daniel Rosenberg via Linux-f2fs-devel
Add charset encoding to f2fs to support casefolding. It is modeled after the same feature introduced in commit c83ad55eaa91 ("ext4: include charset encoding information in the superblock") Currently this is not compatible with encryption, similar to the current ext4 imlpementation. This will chang

[f2fs-dev] [PATCH 7/8] ext4: Hande casefolding with encryption

2019-12-02 Thread Daniel Rosenberg via Linux-f2fs-devel
This adds support for encryption with casefolding. Since the name on disk is case preserving, and also encrypted, we can no longer just recompute the hash on the fly. Additionally, to avoid leaking extra information from the hash of the unencrypted name, we use siphash via an fscrypt v2 policy. T

[f2fs-dev] [PATCH 1/8] fscrypt: Add siphash and hash key for policy v2

2019-12-02 Thread Daniel Rosenberg via Linux-f2fs-devel
When using casefolding along with encryption, we need to use a cryptographic hash to allow fast filesystem operations while not knowing the case of the name stored on disk while not revealing extra information about the name if the key is not present. When a v2 policy is used on a directory, we de

[f2fs-dev] [PATCH 6/8] ext4: Use struct super_block's casefold data

2019-12-02 Thread Daniel Rosenberg via Linux-f2fs-devel
Switch over to using the struct entries added to the VFS, and remove the redundant dentry operations. Signed-off-by: Daniel Rosenberg --- fs/ext4/dir.c | 47 --- fs/ext4/ext4.h | 4 fs/ext4/hash.c | 2 +- fs/ext4/namei.c | 16 ---

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

2019-12-02 Thread Daniel Rosenberg via Linux-f2fs-devel
This expands f2fs's casefolding support to include encrypted directories. For encrypted directories, we use the siphash of the casefolded name. This ensures there is no direct way to go from an unencrypted name to the stored hash on disk without knowledge of the encryption policy keys. Additionall

[f2fs-dev] [PATCH 3/8] fscrypt: Change format of no-key token

2019-12-02 Thread Daniel Rosenberg via Linux-f2fs-devel
Encrypted and casefolded names always require a dirtree hash, since their hash values cannot be generated without the key. In the new format, we always base64 encode the same structure. For names that are less than 149 characters, we concatenate the provided hash and ciphertext. If the name is lon

[f2fs-dev] [PATCH 2/8] fscrypt: Don't allow v1 policies with casefolding

2019-12-02 Thread Daniel Rosenberg via Linux-f2fs-devel
Casefolding requires a derived key for computing the siphash. This is available for v2 policies, but not v1, so we disallow it for v1. Signed-off-by: Daniel Rosenberg --- fs/crypto/policy.c | 26 +++--- fs/inode.c | 8 include/linux/fscrypt.h | 7

[f2fs-dev] [PATCH 8/8] ext4: Optimize match for casefolded encrypted dirs

2019-12-02 Thread Daniel Rosenberg via Linux-f2fs-devel
Matching names with casefolded encrypting directories requires decrypting entries to confirm case since we are case preserving. We can avoid needing to decrypt if our hash values don't match. Signed-off-by: Daniel Rosenberg --- fs/ext4/ext4.h | 17 --- fs/ext4/namei.c | 57 +

[f2fs-dev] [PATCH 4/8] vfs: Fold casefolding into vfs

2019-12-02 Thread Daniel Rosenberg via Linux-f2fs-devel
Ext4 and F2fs are both using casefolding, and they, along with any other filesystem that adds the feature, will be using identical dentry_ops. Additionally, those dentry ops interfere with the dentry_ops required for fscrypt once we add support for casefolding and encryption. Moving this into the v

[f2fs-dev] [PATCH 0/8] Support for Casefolding and Encryption

2019-12-02 Thread Daniel Rosenberg via Linux-f2fs-devel
Ext4 and F2FS currently both support casefolding and encryption, but not at the same time. These patches aim to rectify that. Since directory names are stored case preserved, we cannot just take the hash of the ciphertext. Instead we use the siphash of the casefolded name. With this we no longer h

[f2fs-dev] [PATCH v2 1/6] TMP: fscrypt: Add support for casefolding with encryption

2020-01-06 Thread Daniel Rosenberg via Linux-f2fs-devel
This is a placeholder patch for the patches that were based on the fscypt dev patch. The only affect for the other patches is that they're missing a const or two that top of tree fscrypt would allow. Signed-off-by: Daniel Rosenberg --- This patch is just a placeholder so the rest don't need to be

[f2fs-dev] [PATCH v2 6/6] ext4: Optimize match for casefolded encrypted dirs

2020-01-06 Thread Daniel Rosenberg via Linux-f2fs-devel
Matching names with casefolded encrypting directories requires decrypting entries to confirm case since we are case preserving. We can avoid needing to decrypt if our hash values don't match. Signed-off-by: Daniel Rosenberg --- fs/ext4/ext4.h | 17 --- fs/ext4/namei.c | 55 +

[f2fs-dev] [PATCH v2 4/6] ext4: Use struct super_blocks' casefold data

2020-01-06 Thread Daniel Rosenberg via Linux-f2fs-devel
Switch over to using the struct entries added to the VFS Signed-off-by: Daniel Rosenberg --- fs/ext4/dir.c | 47 --- fs/ext4/ext4.h | 4 fs/ext4/hash.c | 2 +- fs/ext4/namei.c | 20 fs/ext4/super.c | 15 +--

[f2fs-dev] [PATCH v2 2/6] vfs: Fold casefolding into vfs

2020-01-06 Thread Daniel Rosenberg via Linux-f2fs-devel
Ext4 and F2fs are both using casefolding, and they, along with any other filesystem that adds the feature, will be using identical dentry_ops. Additionally, those dentry ops interfere with the dentry_ops required for fscrypt once we add support for casefolding and encryption. Moving this into the v

[f2fs-dev] [PATCH v2 0/6] Support for Casefolding and Encryption

2020-01-06 Thread Daniel Rosenberg via Linux-f2fs-devel
Ext4 and F2FS currently both support casefolding and encryption, but not at the same time. These patches aim to rectify that. Since directory names are stored case preserved, we cannot just take the hash of the ciphertext. Instead we use the siphash of the casefolded name. With this we no longer h

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

2020-01-06 Thread Daniel Rosenberg via Linux-f2fs-devel
This expands f2fs's casefolding support to include encrypted directories. For encrypted directories, we use the siphash of the casefolded name. This ensures there is no direct way to go from an unencrypted name to the stored hash on disk without knowledge of the encryption policy keys. Additionall

[f2fs-dev] [PATCH v2 5/6] ext4: Hande casefolding with encryption

2020-01-06 Thread Daniel Rosenberg via Linux-f2fs-devel
This adds support for encryption with casefolding. Since the name on disk is case preserving, and also encrypted, we can no longer just recompute the hash on the fly. Additionally, to avoid leaking extra information from the hash of the unencrypted name, we use siphash via an fscrypt v2 policy. T

Re: [f2fs-dev] [PATCH v2 0/6] Support for Casefolding and Encryption

2020-01-08 Thread Daniel Rosenberg via Linux-f2fs-devel
On Wed, Jan 8, 2020 at 10:50 AM Theodore Y. Ts'o wrote: > > On Mon, Jan 06, 2020 at 09:16:32PM -0800, Daniel Rosenberg wrote: > > changes: > > fscrypt moved to separate thread to rebase on fscrypt dev branch > > addressed feedback, plus some minor fixes > > What branch was this based on? There is

[f2fs-dev] [PATCH v3 0/9] Support for Casefolding and Encryption

2020-01-17 Thread Daniel Rosenberg via Linux-f2fs-devel
These patches are all on top of fscrypt's developement branch Ext4 and F2FS currently both support casefolding and encryption, but not at the same time. These patches aim to rectify that. Since directory names are stored case preserved, we cannot just take the hash of the ciphertext. Instead we u

[f2fs-dev] [PATCH v3 8/9] ext4: Hande casefolding with encryption

2020-01-17 Thread Daniel Rosenberg via Linux-f2fs-devel
This adds support for encryption with casefolding. Since the name on disk is case preserving, and also encrypted, we can no longer just recompute the hash on the fly. Additionally, to avoid leaking extra information from the hash of the unencrypted name, we use siphash via an fscrypt v2 policy. T

[f2fs-dev] [PATCH v3 5/9] vfs: Fold casefolding into vfs

2020-01-17 Thread Daniel Rosenberg via Linux-f2fs-devel
Ext4 and F2fs are both using casefolding, and they, along with any other filesystem that adds the feature, will be using identical dentry_ops. Additionally, those dentry ops interfere with the dentry_ops required for fscrypt once we add support for casefolding and encryption. Moving this into the v

[f2fs-dev] [PATCH v3 7/9] ext4: Use struct super_blocks' casefold data

2020-01-17 Thread Daniel Rosenberg via Linux-f2fs-devel
Switch over to using the struct entries added to the VFS Signed-off-by: Daniel Rosenberg --- fs/ext4/dir.c | 47 --- fs/ext4/ext4.h | 4 fs/ext4/hash.c | 2 +- fs/ext4/namei.c | 20 fs/ext4/super.c | 15 +--

[f2fs-dev] [PATCH v3 9/9] ext4: Optimize match for casefolded encrypted dirs

2020-01-17 Thread Daniel Rosenberg via Linux-f2fs-devel
Matching names with casefolded encrypting directories requires decrypting entries to confirm case since we are case preserving. We can avoid needing to decrypt if our hash values don't match. Signed-off-by: Daniel Rosenberg --- fs/ext4/ext4.h | 17 --- fs/ext4/namei.c | 55 +

[f2fs-dev] [PATCH v3 2/9] fscrypt: Don't allow v1 policies with casefolding

2020-01-17 Thread Daniel Rosenberg via Linux-f2fs-devel
Casefolding currently requires a derived key for computing the siphash. This is available for v2 policies, but not v1, so we disallow it for v1. Signed-off-by: Daniel Rosenberg --- fs/crypto/policy.c | 28 fs/inode.c | 3 ++- include/linux/fscrypt.

[f2fs-dev] [PATCH v3 3/9] fscrypt: Change format of no-key token

2020-01-17 Thread Daniel Rosenberg via Linux-f2fs-devel
Fscrypt supplies a no-key token in place of file names when the name is encrypted and the key is not present. In the current scheme, the no-key token is the base64 encoded ciphertext of the name, unless the name is longer than a certain amount, after which it uses an alternative scheme which includ

[f2fs-dev] [PATCH v3 1/9] fscrypt: Add siphash and hash key for policy v2

2020-01-17 Thread Daniel Rosenberg via Linux-f2fs-devel
With encryption and casefolding, we cannot simply take the hash of the ciphertext because of case insensitivity, and we can't take the hash of the unencrypted name since that would leak information about the encrypted name. Instead we can use siphash to compute a keyed hash of the file names. When

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

2020-01-17 Thread Daniel Rosenberg via Linux-f2fs-devel
This expands f2fs's casefolding support to include encrypted directories. For encrypted directories, we use the siphash of the casefolded name. This ensures there is no direct way to go from an unencrypted name to the stored hash on disk without knowledge of the encryption policy keys. Additionall

[f2fs-dev] [PATCH v3 4/9] fscrypt: Only create hash key when needed

2020-01-17 Thread Daniel Rosenberg via Linux-f2fs-devel
If a directory isn't casefolded, it doesn't need the hash key. Skip deriving it unless we enable it later. Signed-off-by: Daniel Rosenberg --- fs/crypto/keysetup.c | 2 +- fs/crypto/policy.c | 25 + 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/fs/cryp

Re: [f2fs-dev] [PATCH v5 3/6] fscrypt: clarify what is meant by a per-file key

2020-01-21 Thread Daniel Rosenberg via Linux-f2fs-devel
On Mon, Jan 20, 2020 at 2:34 PM Eric Biggers wrote: > > From: Eric Biggers > > Now that there's sometimes a second type of per-file key (the dirhash > key), clarify some function names, macros, and documentation that > specifically deal with per-file *encryption* keys. > > Signed-off-by: Eric Big

Re: [f2fs-dev] [PATCH v5 0/6] fscrypt preparations for encryption+casefolding

2020-01-23 Thread Daniel Rosenberg via Linux-f2fs-devel
On Wed, Jan 22, 2020 at 3:06 PM Eric Biggers wrote: > > I've applied this series to fscrypt.git#master; however I'd still like > Acked-bys > from the UBIFS maintainers on the two UBIFS patches, as well as more > Reviewed-bys from anyone interested. If I don't hear anything from anyone, I > might

  1   2   3   >