linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] hfs/hfsplus: add uncached buffer io support
@ 2025-06-26 17:30 Yangtao Li
  2025-06-26 17:30 ` [PATCH 1/4] block: Add struct kiocb pointer to block_write_begin() Yangtao Li
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Yangtao Li @ 2025-06-26 17:30 UTC (permalink / raw)
  To: axboe, aivazian.tigran, viro, brauner, jack, linkinjeon,
	sj1557.seo, yuezhang.mo, slava, glaubitz, frank.li, shaggy,
	konishi.ryusuke, almaz.alexandrovich, me, willy, josef, kovalev,
	dave, mhocko, chentaotao
  Cc: linux-block, linux-kernel, linux-fsdevel, linux-ext4,
	jfs-discussion, linux-nilfs, ntfs3, linux-karma-devel, bpf

Hi,

This patchset based git [1], and w/ patchset [2].

[1]
kernel/git/torvalds/linux.git commit id=5e9388f7984a9cc7e659a105113f6ccf0aebedd0
(selftests/bpf: adapt one more case in test_lru_map to the new target_free)

[2]
https://lore.kernel.org/all/20250624121149.2927-1-chentaotao@didiglobal.com/

Yangtao Li (4):
  block: Add struct kiocb pointer to block_write_begin()
  fs/buffer: parse IOCB_DONTCACHE flag in block_write_begin()
  hfsplus: enable uncached buffer io support
  hfs: enable uncached buffer io support

 block/fops.c                |  2 +-
 fs/bfs/file.c               |  2 +-
 fs/buffer.c                 | 13 ++++++++-----
 fs/exfat/inode.c            |  3 +--
 fs/ext2/inode.c             |  2 +-
 fs/hfs/inode.c              |  1 +
 fs/hfsplus/inode.c          |  1 +
 fs/jfs/inode.c              |  2 +-
 fs/minix/inode.c            |  2 +-
 fs/nilfs2/inode.c           |  2 +-
 fs/nilfs2/recovery.c        |  2 +-
 fs/ntfs3/inode.c            |  2 +-
 fs/omfs/file.c              |  2 +-
 fs/udf/inode.c              |  2 +-
 fs/ufs/inode.c              |  2 +-
 include/linux/buffer_head.h |  4 ++--
 16 files changed, 24 insertions(+), 20 deletions(-)

-- 
2.48.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/4] block: Add struct kiocb pointer to block_write_begin()
  2025-06-26 17:30 [PATCH 0/4] hfs/hfsplus: add uncached buffer io support Yangtao Li
@ 2025-06-26 17:30 ` Yangtao Li
  2025-06-26 17:30 ` [PATCH 2/4] fs/buffer: parse IOCB_DONTCACHE flag in block_write_begin() Yangtao Li
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Yangtao Li @ 2025-06-26 17:30 UTC (permalink / raw)
  To: axboe, aivazian.tigran, viro, brauner, jack, linkinjeon,
	sj1557.seo, yuezhang.mo, slava, glaubitz, frank.li, shaggy,
	konishi.ryusuke, almaz.alexandrovich, me, willy, josef, kovalev,
	dave, mhocko, chentaotao
  Cc: linux-block, linux-kernel, linux-fsdevel, linux-ext4,
	jfs-discussion, linux-nilfs, ntfs3, linux-karma-devel, bpf

Refactoring block_write_begin to use struct kiocb for passing write context and
flags.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 block/fops.c                | 2 +-
 fs/bfs/file.c               | 2 +-
 fs/buffer.c                 | 6 +++---
 fs/exfat/inode.c            | 3 +--
 fs/ext2/inode.c             | 2 +-
 fs/jfs/inode.c              | 2 +-
 fs/minix/inode.c            | 2 +-
 fs/nilfs2/inode.c           | 2 +-
 fs/nilfs2/recovery.c        | 2 +-
 fs/ntfs3/inode.c            | 2 +-
 fs/omfs/file.c              | 2 +-
 fs/udf/inode.c              | 2 +-
 fs/ufs/inode.c              | 2 +-
 include/linux/buffer_head.h | 4 ++--
 14 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/block/fops.c b/block/fops.c
index 25ebee01e647..52ab6b5ba794 100644
--- a/block/fops.c
+++ b/block/fops.c
@@ -499,7 +499,7 @@ static void blkdev_readahead(struct readahead_control *rac)
 static int blkdev_write_begin(struct kiocb *iocb, struct address_space *mapping,
 		loff_t pos, unsigned len, struct folio **foliop, void **fsdata)
 {
-	return block_write_begin(mapping, pos, len, foliop, blkdev_get_block);
+	return block_write_begin(iocb, mapping, pos, len, foliop, blkdev_get_block);
 }
 
 static int blkdev_write_end(struct kiocb *iocb, struct address_space *mapping,
diff --git a/fs/bfs/file.c b/fs/bfs/file.c
index 0a8ae8c2346b..860613c876ef 100644
--- a/fs/bfs/file.c
+++ b/fs/bfs/file.c
@@ -176,7 +176,7 @@ static int bfs_write_begin(struct kiocb *iocb, struct address_space *mapping,
 {
 	int ret;
 
-	ret = block_write_begin(mapping, pos, len, foliop, bfs_get_block);
+	ret = block_write_begin(iocb, mapping, pos, len, foliop, bfs_get_block);
 	if (unlikely(ret))
 		bfs_write_failed(mapping, pos + len);
 
diff --git a/fs/buffer.c b/fs/buffer.c
index b42b502fad2f..f2b7b30a76ca 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2247,8 +2247,8 @@ EXPORT_SYMBOL(block_commit_write);
  *
  * The filesystem needs to handle block truncation upon failure.
  */
-int block_write_begin(struct address_space *mapping, loff_t pos, unsigned len,
-		struct folio **foliop, get_block_t *get_block)
+int block_write_begin(struct kiocb *iocb, struct address_space *mapping, loff_t pos,
+		unsigned len, struct folio **foliop, get_block_t *get_block)
 {
 	pgoff_t index = pos >> PAGE_SHIFT;
 	struct folio *folio;
@@ -2598,7 +2598,7 @@ int cont_write_begin(struct kiocb *iocb, struct address_space *mapping,
 		(*bytes)++;
 	}
 
-	return block_write_begin(mapping, pos, len, foliop, get_block);
+	return block_write_begin(iocb, mapping, pos, len, foliop, get_block);
 }
 EXPORT_SYMBOL(cont_write_begin);
 
diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c
index 354edcccc5e3..3032bcc6c951 100644
--- a/fs/exfat/inode.c
+++ b/fs/exfat/inode.c
@@ -455,8 +455,7 @@ static int exfat_write_begin(struct kiocb *iocb, struct address_space *mapping,
 	if (unlikely(exfat_forced_shutdown(mapping->host->i_sb)))
 		return -EIO;
 
-	ret = block_write_begin(mapping, pos, len, foliop, exfat_get_block);
-
+	ret = block_write_begin(iocb, mapping, pos, len, foliop, exfat_get_block);
 	if (ret < 0)
 		exfat_write_failed(mapping, pos+len);
 
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index 66106157c7f0..b6700042db5e 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -920,7 +920,7 @@ ext2_write_begin(struct kiocb *iocb, struct address_space *mapping,
 {
 	int ret;
 
-	ret = block_write_begin(mapping, pos, len, foliop, ext2_get_block);
+	ret = block_write_begin(iocb, mapping, pos, len, foliop, ext2_get_block);
 	if (ret < 0)
 		ext2_write_failed(mapping, pos + len);
 	return ret;
diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c
index ac494186926b..6b90200bab46 100644
--- a/fs/jfs/inode.c
+++ b/fs/jfs/inode.c
@@ -296,7 +296,7 @@ static int jfs_write_begin(struct kiocb *iocb, struct address_space *mapping,
 {
 	int ret;
 
-	ret = block_write_begin(mapping, pos, len, foliop, jfs_get_block);
+	ret = block_write_begin(iocb, mapping, pos, len, foliop, jfs_get_block);
 	if (unlikely(ret))
 		jfs_write_failed(mapping, pos + len);
 
diff --git a/fs/minix/inode.c b/fs/minix/inode.c
index 01011b5d045e..85fb73b37fe8 100644
--- a/fs/minix/inode.c
+++ b/fs/minix/inode.c
@@ -448,7 +448,7 @@ static int minix_write_begin(struct kiocb *iocb, struct address_space *mapping,
 {
 	int ret;
 
-	ret = block_write_begin(mapping, pos, len, foliop, minix_get_block);
+	ret = block_write_begin(iocb, mapping, pos, len, foliop, minix_get_block);
 	if (unlikely(ret))
 		minix_write_failed(mapping, pos + len);
 
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c
index 0ee4dea7f364..95cc7e1130bc 100644
--- a/fs/nilfs2/inode.c
+++ b/fs/nilfs2/inode.c
@@ -229,7 +229,7 @@ static int nilfs_write_begin(struct kiocb *iocb, struct address_space *mapping,
 	if (unlikely(err))
 		return err;
 
-	err = block_write_begin(mapping, pos, len, foliop, nilfs_get_block);
+	err = block_write_begin(iocb, mapping, pos, len, foliop, nilfs_get_block);
 	if (unlikely(err)) {
 		nilfs_write_failed(mapping, pos + len);
 		nilfs_transaction_abort(inode->i_sb);
diff --git a/fs/nilfs2/recovery.c b/fs/nilfs2/recovery.c
index 22aecf6e2344..6bea9f9f445d 100644
--- a/fs/nilfs2/recovery.c
+++ b/fs/nilfs2/recovery.c
@@ -541,7 +541,7 @@ static int nilfs_recover_dsync_blocks(struct the_nilfs *nilfs,
 		}
 
 		pos = rb->blkoff << inode->i_blkbits;
-		err = block_write_begin(inode->i_mapping, pos, blocksize,
+		err = block_write_begin(iocb, inode->i_mapping, pos, blocksize,
 					&folio, nilfs_get_block);
 		if (unlikely(err)) {
 			loff_t isize = inode->i_size;
diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c
index 82c09c2fcadb..36d1baf95b84 100644
--- a/fs/ntfs3/inode.c
+++ b/fs/ntfs3/inode.c
@@ -947,7 +947,7 @@ int ntfs_write_begin(struct kiocb *iocb, struct address_space *mapping,
 			goto out;
 	}
 
-	err = block_write_begin(mapping, pos, len, foliop,
+	err = block_write_begin(iocb, mapping, pos, len, foliop,
 				ntfs_get_block_write_begin);
 
 out:
diff --git a/fs/omfs/file.c b/fs/omfs/file.c
index 3ae86bc2460a..3e687791da4e 100644
--- a/fs/omfs/file.c
+++ b/fs/omfs/file.c
@@ -316,7 +316,7 @@ static int omfs_write_begin(struct kiocb *iocb, struct address_space *mapping,
 {
 	int ret;
 
-	ret = block_write_begin(mapping, pos, len, foliop, omfs_get_block);
+	ret = block_write_begin(iocb, mapping, pos, len, foliop, omfs_get_block);
 	if (unlikely(ret))
 		omfs_write_failed(mapping, pos + len);
 
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 13ea9aaa30e2..2b4db08e4205 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -254,7 +254,7 @@ static int udf_write_begin(struct kiocb *iocb, struct address_space *mapping,
 	int ret;
 
 	if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) {
-		ret = block_write_begin(mapping, pos, len, foliop,
+		ret = block_write_begin(iocb, mapping, pos, len, foliop,
 					udf_get_block);
 		if (unlikely(ret))
 			udf_write_failed(mapping, pos + len);
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c
index 8b10833ff586..35aa1c97c1a7 100644
--- a/fs/ufs/inode.c
+++ b/fs/ufs/inode.c
@@ -480,7 +480,7 @@ static int ufs_write_begin(struct kiocb *iocb, struct address_space *mapping,
 {
 	int ret;
 
-	ret = block_write_begin(mapping, pos, len, foliop, ufs_getfrag_block);
+	ret = block_write_begin(iocb, mapping, pos, len, foliop, ufs_getfrag_block);
 	if (unlikely(ret))
 		ufs_write_failed(mapping, pos + len);
 
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 56f7a65bd875..58d011cac9b9 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -258,8 +258,8 @@ int __block_write_full_folio(struct inode *inode, struct folio *folio,
 		get_block_t *get_block, struct writeback_control *wbc);
 int block_read_full_folio(struct folio *, get_block_t *);
 bool block_is_partially_uptodate(struct folio *, size_t from, size_t count);
-int block_write_begin(struct address_space *mapping, loff_t pos, unsigned len,
-		struct folio **foliop, get_block_t *get_block);
+int block_write_begin(struct kiocb *iocb, struct address_space *mapping, loff_t pos,
+		unsigned len, struct folio **foliop, get_block_t *get_block);
 int __block_write_begin(struct folio *folio, loff_t pos, unsigned len,
 		get_block_t *get_block);
 int block_write_end(struct file *, struct address_space *,
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/4] fs/buffer: parse IOCB_DONTCACHE flag in block_write_begin()
  2025-06-26 17:30 [PATCH 0/4] hfs/hfsplus: add uncached buffer io support Yangtao Li
  2025-06-26 17:30 ` [PATCH 1/4] block: Add struct kiocb pointer to block_write_begin() Yangtao Li
@ 2025-06-26 17:30 ` Yangtao Li
  2025-07-04 17:29   ` Viacheslav Dubeyko
  2025-06-26 17:30 ` [PATCH 3/4] hfsplus: enable uncached buffer io support Yangtao Li
  2025-06-26 17:30 ` [PATCH 4/4] hfs: " Yangtao Li
  3 siblings, 1 reply; 8+ messages in thread
From: Yangtao Li @ 2025-06-26 17:30 UTC (permalink / raw)
  To: axboe, aivazian.tigran, viro, brauner, jack, linkinjeon,
	sj1557.seo, yuezhang.mo, slava, glaubitz, frank.li, shaggy,
	konishi.ryusuke, almaz.alexandrovich, me, willy, josef, kovalev,
	dave, mhocko, chentaotao
  Cc: linux-block, linux-kernel, linux-fsdevel, linux-ext4,
	jfs-discussion, linux-nilfs, ntfs3, linux-karma-devel, bpf

When iocb flags passes IOCB_DONTCACHE, use FGP_DONTCACHE mode to get folio.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 fs/buffer.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index f2b7b30a76ca..0ed80b62feea 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2251,11 +2251,14 @@ int block_write_begin(struct kiocb *iocb, struct address_space *mapping, loff_t
 		unsigned len, struct folio **foliop, get_block_t *get_block)
 {
 	pgoff_t index = pos >> PAGE_SHIFT;
+	fgf_t fgp = FGP_WRITEBEGIN;
 	struct folio *folio;
 	int status;
 
-	folio = __filemap_get_folio(mapping, index, FGP_WRITEBEGIN,
-			mapping_gfp_mask(mapping));
+	if (iocb->ki_flags & IOCB_DONTCACHE)
+		fgp |= FGP_DONTCACHE;
+
+	folio = __filemap_get_folio(mapping, index, fgp, mapping_gfp_mask(mapping));
 	if (IS_ERR(folio))
 		return PTR_ERR(folio);
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/4] hfsplus: enable uncached buffer io support
  2025-06-26 17:30 [PATCH 0/4] hfs/hfsplus: add uncached buffer io support Yangtao Li
  2025-06-26 17:30 ` [PATCH 1/4] block: Add struct kiocb pointer to block_write_begin() Yangtao Li
  2025-06-26 17:30 ` [PATCH 2/4] fs/buffer: parse IOCB_DONTCACHE flag in block_write_begin() Yangtao Li
@ 2025-06-26 17:30 ` Yangtao Li
  2025-07-04 17:45   ` Viacheslav Dubeyko
  2025-06-26 17:30 ` [PATCH 4/4] hfs: " Yangtao Li
  3 siblings, 1 reply; 8+ messages in thread
From: Yangtao Li @ 2025-06-26 17:30 UTC (permalink / raw)
  To: axboe, aivazian.tigran, viro, brauner, jack, linkinjeon,
	sj1557.seo, yuezhang.mo, slava, glaubitz, frank.li, shaggy,
	konishi.ryusuke, almaz.alexandrovich, me, willy, josef, kovalev,
	dave, mhocko, chentaotao
  Cc: linux-block, linux-kernel, linux-fsdevel, linux-ext4,
	jfs-discussion, linux-nilfs, ntfs3, linux-karma-devel, bpf

Now cont_write_begin() support DONTCACHE mode, let's set FOP_DONTCACHE
flag to enable uncached buffer io support for hfsplus.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 fs/hfsplus/inode.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
index 26cc150856b9..b790ffe92019 100644
--- a/fs/hfsplus/inode.c
+++ b/fs/hfsplus/inode.c
@@ -372,6 +372,7 @@ static const struct file_operations hfsplus_file_operations = {
 	.open		= hfsplus_file_open,
 	.release	= hfsplus_file_release,
 	.unlocked_ioctl = hfsplus_ioctl,
+	.fop_flags	= FOP_DONTCACHE,
 };
 
 struct inode *hfsplus_new_inode(struct super_block *sb, struct inode *dir,
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/4] hfs: enable uncached buffer io support
  2025-06-26 17:30 [PATCH 0/4] hfs/hfsplus: add uncached buffer io support Yangtao Li
                   ` (2 preceding siblings ...)
  2025-06-26 17:30 ` [PATCH 3/4] hfsplus: enable uncached buffer io support Yangtao Li
@ 2025-06-26 17:30 ` Yangtao Li
  2025-07-04 17:37   ` Viacheslav Dubeyko
  3 siblings, 1 reply; 8+ messages in thread
From: Yangtao Li @ 2025-06-26 17:30 UTC (permalink / raw)
  To: axboe, aivazian.tigran, viro, brauner, jack, linkinjeon,
	sj1557.seo, yuezhang.mo, slava, glaubitz, frank.li, shaggy,
	konishi.ryusuke, almaz.alexandrovich, me, willy, josef, kovalev,
	dave, mhocko, chentaotao
  Cc: linux-block, linux-kernel, linux-fsdevel, linux-ext4,
	jfs-discussion, linux-nilfs, ntfs3, linux-karma-devel, bpf

Now cont_write_begin() support DONTCACHE mode, let's set FOP_DONTCACHE
flag to enable uncached buffer io support for hfs.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 fs/hfs/inode.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
index 8409e4412366..a62f45e9745d 100644
--- a/fs/hfs/inode.c
+++ b/fs/hfs/inode.c
@@ -695,6 +695,7 @@ static const struct file_operations hfs_file_operations = {
 	.fsync		= hfs_file_fsync,
 	.open		= hfs_file_open,
 	.release	= hfs_file_release,
+	.fop_flags	= FOP_DONTCACHE,
 };
 
 static const struct inode_operations hfs_file_inode_operations = {
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/4] fs/buffer: parse IOCB_DONTCACHE flag in block_write_begin()
  2025-06-26 17:30 ` [PATCH 2/4] fs/buffer: parse IOCB_DONTCACHE flag in block_write_begin() Yangtao Li
@ 2025-07-04 17:29   ` Viacheslav Dubeyko
  0 siblings, 0 replies; 8+ messages in thread
From: Viacheslav Dubeyko @ 2025-07-04 17:29 UTC (permalink / raw)
  To: Yangtao Li, axboe, aivazian.tigran, viro, brauner, jack,
	linkinjeon, sj1557.seo, yuezhang.mo, glaubitz, shaggy,
	konishi.ryusuke, almaz.alexandrovich, me, willy, josef, kovalev,
	dave, mhocko, chentaotao
  Cc: linux-block, linux-kernel, linux-fsdevel, linux-ext4,
	jfs-discussion, linux-nilfs, ntfs3, linux-karma-devel, bpf

On Thu, 2025-06-26 at 11:30 -0600, Yangtao Li wrote:
> When iocb flags passes IOCB_DONTCACHE, use FGP_DONTCACHE mode to get
> folio.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>  fs/buffer.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/buffer.c b/fs/buffer.c
> index f2b7b30a76ca..0ed80b62feea 100644
> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -2251,11 +2251,14 @@ int block_write_begin(struct kiocb *iocb,
> struct address_space *mapping, loff_t
>  		unsigned len, struct folio **foliop, get_block_t
> *get_block)
>  {
>  	pgoff_t index = pos >> PAGE_SHIFT;
> +	fgf_t fgp = FGP_WRITEBEGIN;
>  	struct folio *folio;
>  	int status;
>  
> -	folio = __filemap_get_folio(mapping, index, FGP_WRITEBEGIN,
> -			mapping_gfp_mask(mapping));
> +	if (iocb->ki_flags & IOCB_DONTCACHE)
> +		fgp |= FGP_DONTCACHE;
> +
> +	folio = __filemap_get_folio(mapping, index, fgp,
> mapping_gfp_mask(mapping));
>  	if (IS_ERR(folio))
>  		return PTR_ERR(folio);
>  

Correct me if I am wrong. As far as I can see, the first patch depends
from  second one. It means that if somebody applies the first patch
but, somehow, don't apply the second one, then nobody will be able to
compile the kernel code. Am I correct?

Why do we need to make this modification and, then, touch other file
systems? What the justification of this? Why do we need to make this
modification at the first place?

Thanks,
Slava.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 4/4] hfs: enable uncached buffer io support
  2025-06-26 17:30 ` [PATCH 4/4] hfs: " Yangtao Li
@ 2025-07-04 17:37   ` Viacheslav Dubeyko
  0 siblings, 0 replies; 8+ messages in thread
From: Viacheslav Dubeyko @ 2025-07-04 17:37 UTC (permalink / raw)
  To: Yangtao Li, axboe, aivazian.tigran, viro, brauner, jack,
	linkinjeon, sj1557.seo, yuezhang.mo, glaubitz, shaggy,
	konishi.ryusuke, almaz.alexandrovich, me, willy, josef, kovalev,
	dave, mhocko, chentaotao
  Cc: linux-block, linux-kernel, linux-fsdevel, linux-ext4,
	jfs-discussion, linux-nilfs, ntfs3, linux-karma-devel, bpf

On Thu, 2025-06-26 at 11:30 -0600, Yangtao Li wrote:
> Now cont_write_begin() support DONTCACHE mode, let's set
> FOP_DONTCACHE
> flag to enable uncached buffer io support for hfs.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>  fs/hfs/inode.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
> index 8409e4412366..a62f45e9745d 100644
> --- a/fs/hfs/inode.c
> +++ b/fs/hfs/inode.c
> @@ -695,6 +695,7 @@ static const struct file_operations
> hfs_file_operations = {
>  	.fsync		= hfs_file_fsync,
>  	.open		= hfs_file_open,
>  	.release	= hfs_file_release,
> +	.fop_flags	= FOP_DONTCACHE,
>  };
>  
>  static const struct inode_operations hfs_file_inode_operations = {

Frankly speaking, I am not convinced that HFS really need to support
this feature. It is old and pretty obsolete file system. The main use-
case is simply support the capability to mount HFS volume is created
under Mac OS X, for example, and to access the data there. Of course,
we can support this feature, but what is the point of this?

As far as I can see, the goal of RWF_DONTCACHE feature is:

"Common for both reads and writes with RWF_DONTCACHE is that they use
the page cache for IO. Reads work just like a normal buffered read
would, with the only exception being that the touched ranges will get
pruned after data has been copied. For writes, the ranges will get
writeback kicked off before the syscall returns, and then writeback
completion will prune the range."

So, who would like to see such efficiency in HFS? Do we really need to
support it in HFS? I think that it is not.

Thanks,
Slava.  

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/4] hfsplus: enable uncached buffer io support
  2025-06-26 17:30 ` [PATCH 3/4] hfsplus: enable uncached buffer io support Yangtao Li
@ 2025-07-04 17:45   ` Viacheslav Dubeyko
  0 siblings, 0 replies; 8+ messages in thread
From: Viacheslav Dubeyko @ 2025-07-04 17:45 UTC (permalink / raw)
  To: Yangtao Li, axboe, aivazian.tigran, viro, brauner, jack,
	linkinjeon, sj1557.seo, yuezhang.mo, glaubitz, shaggy,
	konishi.ryusuke, almaz.alexandrovich, me, willy, josef, kovalev,
	dave, mhocko, chentaotao
  Cc: linux-block, linux-kernel, linux-fsdevel, linux-ext4,
	jfs-discussion, linux-nilfs, ntfs3, linux-karma-devel, bpf

On Thu, 2025-06-26 at 11:30 -0600, Yangtao Li wrote:
> Now cont_write_begin() support DONTCACHE mode, let's set
> FOP_DONTCACHE
> flag to enable uncached buffer io support for hfsplus.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>  fs/hfsplus/inode.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
> index 26cc150856b9..b790ffe92019 100644
> --- a/fs/hfsplus/inode.c
> +++ b/fs/hfsplus/inode.c
> @@ -372,6 +372,7 @@ static const struct file_operations
> hfsplus_file_operations = {
>  	.open		= hfsplus_file_open,
>  	.release	= hfsplus_file_release,
>  	.unlocked_ioctl = hfsplus_ioctl,
> +	.fop_flags	= FOP_DONTCACHE,
>  };
>  
>  struct inode *hfsplus_new_inode(struct super_block *sb, struct inode
> *dir,

The same question for HFS+. Because, it is again old and pretty
obsolete file system. :) The main use-case is simply support the
capability to mount HFS+ volume is created under Mac OS X, for example,
and to access the data there. What is the point to support this feature
in HFS+? Currently, around 200 xfstests fails in HFS/HFS+. We even
cannot test any new functionality properly. And guys reports bugs in
existing functionality. We need to be focused on this right now. Sorry,
HFS/HFS+ is not so good ground for implementing new features. :)
We really need to stabilize the existing functionality right now. And
we have a lot of work yet. :) 

Thanks,
Slava. 

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-07-04 17:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-26 17:30 [PATCH 0/4] hfs/hfsplus: add uncached buffer io support Yangtao Li
2025-06-26 17:30 ` [PATCH 1/4] block: Add struct kiocb pointer to block_write_begin() Yangtao Li
2025-06-26 17:30 ` [PATCH 2/4] fs/buffer: parse IOCB_DONTCACHE flag in block_write_begin() Yangtao Li
2025-07-04 17:29   ` Viacheslav Dubeyko
2025-06-26 17:30 ` [PATCH 3/4] hfsplus: enable uncached buffer io support Yangtao Li
2025-07-04 17:45   ` Viacheslav Dubeyko
2025-06-26 17:30 ` [PATCH 4/4] hfs: " Yangtao Li
2025-07-04 17:37   ` Viacheslav Dubeyko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).