Skip to contentSkip to conversation

f2fs: fix to return -EOPNOTSUPP for uncached write

PATCH In review Chao Yu 2 participants 3 messages Aug 5, 2025 – Aug 6, 2025 F2FS file system

lore
Share & tools
lore

Chao Yu

author maintainer
#0 lore raw

PATCH v2 1/1 f2fs: fix to return -EOPNOTSUPP for uncached write

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.

---
v2:
- fix author info

 fs/f2fs/file.c | 5 +++++
 1 file changed, 5 insertions(+)
fs/f2fs/file.c +5 -0
index 9b8d24097b7a..7f09cad6b6d7 100644
@@ -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;
Signature · 1 line
2.49.0
#1 lore raw
Quoted 3 lines · Chao Yu

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.

Didn't we agree that write support should be pursued first before bifurcating the read/write DONTCACHE support?

Signature · 1 line
Jens Axboe
author maintainer
#2 lore raw
Quoted 7 lines · Jens Axboe
Quoted 3 lines · Chao Yu

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.

Didn't we agree that write support should be pursued first before bifurcating the read/write DONTCACHE support?

Yeah, no worries, this is just used for test purpose, will drop this once Qi Han prepare the new patchset supporting dontcache in both read and write path. :)

Thanks,