summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-04-19 01:34:15 +0000
committerMiles Bader <miles@gnu.org>1995-04-19 01:34:15 +0000
commit7b913237af5fdd4530bfedc1413cc2624cdfb784 (patch)
tree13505d27f1e57ddf58b74542f8f88ea21cc2cab8
parent1ce9dbae1b47fd376dfc868ff06fb004a8f8dac6 (diff)
Formerly ialloc.c.~16~
-rw-r--r--ext2fs/ialloc.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/ext2fs/ialloc.c b/ext2fs/ialloc.c
index 2a733909..43deda75 100644
--- a/ext2fs/ialloc.c
+++ b/ext2fs/ialloc.c
@@ -57,6 +57,10 @@ diskfs_free_node (struct node *np, mode_t old_mode)
struct ext2_group_desc *gdp;
ino_t inum = np->dn->number;
+ if (diskfs_readonly)
+ ext2_panic ("diskfs_free_node",
+ "Freeing inode %d on a readonly filesystem", inum);
+
ext2_debug ("freeing inode %lu\n", inum);
spin_lock (&global_lock);
@@ -273,7 +277,12 @@ diskfs_alloc_node (struct node *dir, mode_t mode, struct node **node)
error_t err;
int sex;
struct node *np;
- ino_t inum = ext2_alloc_inode (dir->dn->number, mode);
+ ino_t inum;
+
+ if (diskfs_readonly)
+ return EROFS;
+
+ inum = ext2_alloc_inode (dir->dn->number, mode);
if (inum == 0)
return ENOSPC;