#endif
inode = osd_sb(o)->s_root->d_inode;
lu_local_obj_fid(fid, OSD_FS_ROOT_OID);
- rc = osd_ea_fid_set(info, inode, fid, LMAC_NOT_IN_OI, 0);
- if (rc != 0) {
- CERROR("%s: failed to set lma on %s root inode\n", name, dev);
- GOTO(out_mnt, rc);
+ if (!o->od_dt_dev.dd_rdonly) {
+ rc = osd_ea_fid_set(info, inode, fid, LMAC_NOT_IN_OI, 0);
+ if (rc != 0) {
+ CERROR("%s: failed to set lma on %s root inode\n",
+ name, dev);
+ GOTO(out_mnt, rc);
+ }
}
if (lmd_flags & LMD_FLG_NOSCRUB)
scrub->os_auto_scrub_interval = interval;
push_ctxt(&saved, ctxt);
- filp = filp_open(osd_scrub_name, O_RDWR |
- (dev->od_dt_dev.dd_rdonly ? 0 : O_CREAT), 0644);
+ filp = filp_open(osd_scrub_name,
+ (dev->od_dt_dev.dd_rdonly ? O_RDONLY :
+ O_RDWR | O_CREAT),
+ 0644);
if (IS_ERR(filp)) {
pop_ctxt(&saved, ctxt);
RETURN(PTR_ERR(filp));