From 423ecd487873ae12c040512ac56686b4f6b8dee9 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 4 Feb 2025 19:20:15 +0100 Subject: libdiskfs: Check for EROFS on io_prenotify and io_write too This avoids Assertion `!diskfs_readonly' failed. messages at shutdown. --- libdiskfs/io-prenotify.c | 5 ++++- libdiskfs/io-write.c | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libdiskfs/io-prenotify.c b/libdiskfs/io-prenotify.c index 4eb1c657..e8cd10e4 100644 --- a/libdiskfs/io-prenotify.c +++ b/libdiskfs/io-prenotify.c @@ -33,7 +33,10 @@ diskfs_S_io_prenotify (struct protid *cred, if (!cred) return EOPNOTSUPP; - + + if (diskfs_check_readonly ()) + return EROFS; + np = cred->po->np; /* Clamp it down */ diff --git a/libdiskfs/io-write.c b/libdiskfs/io-write.c index 2e47c81c..17455bbc 100644 --- a/libdiskfs/io-write.c +++ b/libdiskfs/io-write.c @@ -35,6 +35,9 @@ diskfs_S_io_write (struct protid *cred, if (!cred) return EOPNOTSUPP; + if (diskfs_check_readonly ()) + return EROFS; + np = cred->po->np; if (!(cred->po->openstat & O_WRITE)) return EBADF; -- cgit v1.2.3