/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2015 by Chunwei Chen. All rights reserved.
*/
SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_FLAGS(zsb), NULL,
&zp->z_pflags, 8);
+ /*
+ * Callers might not be able to detect properly that we are read-only,
+ * so check it explicitly here.
+ */
+ if (zfs_is_readonly(zsb)) {
+ ZFS_EXIT(zsb);
+ return (SET_ERROR(EROFS));
+ }
+
/*
* If immutable or not appending then return EPERM
*/
return (SET_ERROR(EINVAL));
}
+ /*
+ * Callers might not be able to detect properly that we are read-only,
+ * so check it explicitly here.
+ */
+ if (zfs_is_readonly(zsb)) {
+ ZFS_EXIT(zsb);
+ return (SET_ERROR(EROFS));
+ }
+
if ((error = convoff(ip, bfp, 0, offset))) {
ZFS_EXIT(zsb);
return (error);