Skip to content

Commit

Permalink
Check the device read-only property during mount.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhub committed Sep 7, 2011
1 parent 5e960a9 commit 2def836
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rtems/rtems_yaffs.c
Expand Up @@ -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);
Expand Down

0 comments on commit 2def836

Please sign in to comment.