Whamcloud - gitweb
LU-8900 snapshot: simulate readonly device
[fs/lustre-release.git] / lustre / quota / qsd_handler.c
index b90ecc0..0982e93 100644 (file)
@@ -833,6 +833,9 @@ int qsd_op_begin(const struct lu_env *env, struct qsd_instance *qsd,
        if (unlikely(qsd == NULL))
                RETURN(0);
 
+       if (qsd->qsd_dev->dd_rdonly)
+               RETURN(0);
+
        /* We don't enforce quota until the qsd_instance is started */
        read_lock(&qsd->qsd_lock);
        if (!qsd->qsd_started) {
@@ -922,6 +925,9 @@ int qsd_adjust(const struct lu_env *env, struct lquota_entry *lqe)
        qqi = lqe2qqi(lqe);
        qsd = qqi->qqi_qsd;
 
+       if (qsd->qsd_dev->dd_rdonly)
+               RETURN(0);
+
        lqe_write_lock(lqe);
 
        /* fill qb_count & qb_flags */
@@ -1075,6 +1081,9 @@ void qsd_op_end(const struct lu_env *env, struct qsd_instance *qsd,
        if (unlikely(qsd == NULL))
                RETURN_EXIT;
 
+       if (qsd->qsd_dev->dd_rdonly)
+               RETURN_EXIT;
+
        /* We don't enforce quota until the qsd_instance is started */
        read_lock(&qsd->qsd_lock);
        if (!qsd->qsd_started) {