int rc;
ENTRY;
+ if (dev->od_dt_dev.dd_rdonly)
+ RETURN(-EROFS);
+
/* os_lock: sync status between stop and scrub thread */
spin_lock(&scrub->os_lock);
* later if found that the system is upgrading. */
dev->od_igif_inoi = 1;
- if (!dev->od_noscrub &&
+ if (!dev->od_dt_dev.dd_rdonly && !dev->od_noscrub &&
((sf->sf_status == SS_PAUSED) ||
(sf->sf_status == SS_CRASHED &&
sf->sf_flags & (SF_RECREATED | SF_INCONSISTENT |