obd_no_ir:1, /* no imperative recovery. */
obd_process_conf:1, /* device is processing mgs config */
obd_checksum_dump:1, /* dump pages upon cksum error */
- obd_dynamic_nids:1; /* Allow dynamic NIDs on device */
+ obd_dynamic_nids:1, /* Allow dynamic NIDs on device */
+ obd_read_only:1; /* device is read-only */
#ifdef HAVE_SERVER_SUPPORT
/* no committed-transno notification */
unsigned long obd_no_transno:1;
#include <lustre_lib.h>
#include <uapi/linux/lustre/lustre_idl.h>
#include <lprocfs_status.h>
+#include <dt_object.h>
#define OBD_STATFS_NODELAY 0x0001 /* requests should be send without delay
* and resends for avoid deadlocks */
if (!IS_ERR(dev)) {
obd->obd_lu_dev = dev;
dev->ld_obd = obd;
+ if (lu_device_is_dt(dev) &&
+ lu2dt_dev(dev)->dd_rdonly)
+ obd->obd_read_only = 1;
rc = 0;
} else
rc = PTR_ERR(dev);
if (obd->obd_stopping)
continue;
+ if (obd->obd_read_only)
+ continue;
+
class_incref(obd, __func__, current);
read_unlock(&obd_dev_lock);
d = m->ofd_osd_exp->exp_obd->obd_lu_dev;
LASSERT(d);
m->ofd_osd = lu2dt_dev(d);
+ if (m->ofd_osd->dd_rdonly)
+ ofd_obd(m)->obd_read_only = 1;
snprintf(info->fti_u.name, sizeof(info->fti_u.name),
"%s-osd", lustre_cfg_string(cfg, 0));