aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2025-02-04 19:20:15 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2025-02-04 19:20:43 +0100
commit423ecd487873ae12c040512ac56686b4f6b8dee9 (patch)
treebe19d21bb3e5d3790ceb6079fc40d839e707b2e2
parente14ea255a5ad7fce32bd8dc3984fdc2377bf92b8 (diff)
downloadhurd-423ecd487873ae12c040512ac56686b4f6b8dee9.tar.gz
hurd-423ecd487873ae12c040512ac56686b4f6b8dee9.tar.bz2
hurd-423ecd487873ae12c040512ac56686b4f6b8dee9.zip
libdiskfs: Check for EROFS on io_prenotify and io_write too
This avoids Assertion `!diskfs_readonly' failed. messages at shutdown.
-rw-r--r--libdiskfs/io-prenotify.c5
-rw-r--r--libdiskfs/io-write.c3
2 files changed, 7 insertions, 1 deletions
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;