Whamcloud - gitweb
LU-10192 osd-zfs: create agent entry for remote entry
[fs/lustre-release.git] / lustre / fid / fid_handler.c
index 98c94f1..537ea6d 100644 (file)
  *
  * You should have received a copy of the GNU General Public License
  * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
  *
  * GPL HEADER END
  */
@@ -211,7 +207,7 @@ static int __seq_set_init(const struct lu_env *env,
  *
  * when lss_lowater_set reaches the end it is replaced with hiwater one and
  * a write operation is initiated to allocate new hiwater range.
- * if last seq write opearion is still not commited, current operation is
+ * if last seq write opearion is still not committed, current operation is
  * flaged as sync write op.
  */
 static int range_alloc_set(const struct lu_env *env,
@@ -368,6 +364,7 @@ static int seq_server_handle(struct lu_site *site,
 {
        int rc;
        struct seq_server_site *ss_site;
+       struct dt_device *dev;
        ENTRY;
 
        ss_site = lu_site2seq(site);
@@ -379,6 +376,11 @@ static int seq_server_handle(struct lu_site *site,
                               "initialized\n");
                        RETURN(-EINVAL);
                }
+
+               dev = lu2dt_dev(ss_site->ss_server_seq->lss_obj->do_lu.lo_dev);
+               if (dev->dd_rdonly)
+                       RETURN(-EROFS);
+
                rc = seq_server_alloc_meta(ss_site->ss_server_seq, out, env);
                break;
        case SEQ_ALLOC_SUPER:
@@ -387,6 +389,11 @@ static int seq_server_handle(struct lu_site *site,
                               "initialized\n");
                        RETURN(-EINVAL);
                }
+
+               dev = lu2dt_dev(ss_site->ss_control_seq->lss_obj->do_lu.lo_dev);
+               if (dev->dd_rdonly)
+                       RETURN(-EROFS);
+
                rc = seq_server_alloc_super(ss_site->ss_control_seq, out, env);
                break;
        default: