[Yaffs] [PATCH 09/20] Check the device read-only property du…

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Xiangfu Liu
Date:  
To: yaffs
CC: sebastien
Old-Topics: [Yaffs] [PATCH 08/20] Implemented data synchronization.
New-Topics: [Yaffs] [PATCH 10/20] Changed seek mechanic.
Subject: [Yaffs] [PATCH 09/20] Check the device read-only property during mount.
From: Sebastian Huber <>

---
 rtems/rtems_yaffs.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)


diff --git a/rtems/rtems_yaffs.c b/rtems/rtems_yaffs.c
index d987685..f6869cd 100644
--- a/rtems/rtems_yaffs.c
+++ b/rtems/rtems_yaffs.c
@@ -790,6 +790,11 @@ int rtems_yaffs_mount_handler(rtems_filesystem_mount_table_entry_t *mt_entry, co
     const rtems_yaffs_mount_data *mount_data = data;
     struct yaffs_dev *dev = mount_data->dev;


+    if (dev->read_only && (mt_entry->options & RTEMS_FILESYSTEM_READ_WRITE) != 0) {
+        errno = EACCES;
+        return -1;
+    }
+
     ylock(dev);
     if (yaffs_guts_initialise(dev) == YAFFS_FAIL) {
         yunlock(dev);
-- 
1.7.4.1