linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] f2fs: fix to return -EOPNOTSUPP for uncached write
@ 2025-08-02  2:37 Chao Yu via Linux-f2fs-devel
  2025-08-03 11:33 ` Markus Elfring via Linux-f2fs-devel
  0 siblings, 1 reply; 4+ messages in thread
From: Chao Yu via Linux-f2fs-devel @ 2025-08-02  2:37 UTC (permalink / raw)
  To: jaegeuk; +Cc: Jens Axboe, Qi Han, linux-kernel, linux-f2fs-devel

From: Qi Han <hanqi@vivo.com>

f2fs doesn't support uncached write yet, for write() w/ IOCB_DONTCACHE
flag, let's return -EOPNOTSUPP instead of ignoring IOCB_DONTCACHE flag
and write w/o uncached IO.

Cc: Jens Axboe <axboe@kernel.dk>
Cc: Qi Han <hanqi@vivo.com>
Signed-off-by: Chao Yu <chao@kernel.org>
---
 fs/f2fs/file.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 9b8d24097b7a..7f09cad6b6d7 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -5185,6 +5185,11 @@ static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
 		goto out;
 	}
 
+	if (iocb->ki_flags & IOCB_DONTCACHE) {
+		ret = -EOPNOTSUPP;
+		goto out;
+	}
+
 	if (!f2fs_is_compress_backend_ready(inode)) {
 		ret = -EOPNOTSUPP;
 		goto out;
-- 
2.49.0



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

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

* Re: [f2fs-dev] [PATCH] f2fs: fix to return -EOPNOTSUPP for uncached write
  2025-08-02  2:37 [f2fs-dev] [PATCH] " Chao Yu via Linux-f2fs-devel
@ 2025-08-03 11:33 ` Markus Elfring via Linux-f2fs-devel
  0 siblings, 0 replies; 4+ messages in thread
From: Markus Elfring via Linux-f2fs-devel @ 2025-08-03 11:33 UTC (permalink / raw)
  To: Chao Yu, linux-f2fs-devel, Jaegeuk Kim; +Cc: Jens Axboe, Qi Han, LKML> +++ b/fs/f2fs/file.c
> @@ -5185,6 +5185,11 @@ static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
>  		goto out;
>  	}
>  
> +	if (iocb->ki_flags & IOCB_DONTCACHE) {
> +		ret = -EOPNOTSUPP;
> +		goto out;
> +	}
> +
>  	if (!f2fs_is_compress_backend_ready(inode)) {
>  		ret = -EOPNOTSUPP;
>  		goto out;

Can it be avoided to specify duplicate exception handling?
May the condition checks be merged for these if statements?

Regards,
Markus


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

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

* [f2fs-dev] [PATCH] f2fs: fix to return -EOPNOTSUPP for uncached write
@ 2025-08-05  6:17 Chao Yu via Linux-f2fs-devel
  2025-08-05  9:16 ` [f2fs-dev] [PATCH v?] " Markus Elfring via Linux-f2fs-devel
  0 siblings, 1 reply; 4+ messages in thread
From: Chao Yu via Linux-f2fs-devel @ 2025-08-05  6:17 UTC (permalink / raw)
  To: jaegeuk; +Cc: Jens Axboe, Qi Han, linux-kernel, linux-f2fs-devel

f2fs doesn't support uncached write yet, for write() w/ IOCB_DONTCACHE
flag, let's return -EOPNOTSUPP instead of ignoring IOCB_DONTCACHE flag
and write w/o uncached IO.

Cc: Jens Axboe <axboe@kernel.dk>
Cc: Qi Han <hanqi@vivo.com>
Signed-off-by: Chao Yu <chao@kernel.org>
---
v2:
- fix author info
 fs/f2fs/file.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 9b8d24097b7a..7f09cad6b6d7 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -5185,6 +5185,11 @@ static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
 		goto out;
 	}
 
+	if (iocb->ki_flags & IOCB_DONTCACHE) {
+		ret = -EOPNOTSUPP;
+		goto out;
+	}
+
 	if (!f2fs_is_compress_backend_ready(inode)) {
 		ret = -EOPNOTSUPP;
 		goto out;
-- 
2.49.0



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

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

* Re: [f2fs-dev] [PATCH v?] f2fs: fix to return -EOPNOTSUPP for uncached write
  2025-08-05  6:17 [f2fs-dev] [PATCH] f2fs: fix to return -EOPNOTSUPP for uncached write Chao Yu via Linux-f2fs-devel
@ 2025-08-05  9:16 ` Markus Elfring via Linux-f2fs-devel
  0 siblings, 0 replies; 4+ messages in thread
From: Markus Elfring via Linux-f2fs-devel @ 2025-08-05  9:16 UTC (permalink / raw)
  To: Chao Yu, linux-f2fs-devel, Jaegeuk Kim; +Cc: Jens Axboe, Qi Han, LKML

> f2fs doesn't support uncached write yet, for write() w/ IOCB_DONTCACHE
> flag, let's return -EOPNOTSUPP instead of ignoring IOCB_DONTCACHE flag
> and write w/o uncached IO.

See also once more:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.16#n94> ---
> v2:
…

Should a corresponding information appear in the patch subject?


…
> +++ b/fs/f2fs/file.c
> @@ -5185,6 +5185,11 @@ static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
>  		goto out;
>  	}
>  
> +	if (iocb->ki_flags & IOCB_DONTCACHE) {
> +		ret = -EOPNOTSUPP;
> +		goto out;
> +	}
> +
>  	if (!f2fs_is_compress_backend_ready(inode)) {
>  		ret = -EOPNOTSUPP;
>  		goto out;

Can it be avoided to specify duplicate exception handling?
May the condition checks be merged for these if statements?

Regards,
Markus


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

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

end of thread, other threads:[~2025-08-05  9:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-05  6:17 [f2fs-dev] [PATCH] f2fs: fix to return -EOPNOTSUPP for uncached write Chao Yu via Linux-f2fs-devel
2025-08-05  9:16 ` [f2fs-dev] [PATCH v?] " Markus Elfring via Linux-f2fs-devel
  -- strict thread matches above, loose matches on Subject: below --
2025-08-02  2:37 [f2fs-dev] [PATCH] " Chao Yu via Linux-f2fs-devel
2025-08-03 11:33 ` Markus Elfring via Linux-f2fs-devel

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