.BR acl (5)
manual page.
.TP
+.BI no_precreate
+Do not allow objects to be created on the OST after mounting. This
+allows a (potentially newly-formatted) OST to be started without
+clients starting to use it immediately. To allow the MDS to create
+objects on the OST mount without this option, or run
+.BI "lctl set_param obdfilter." fsname -OST nnnn .no_precreate=0
+on the OSS to re-enable object creation.
+.BR NOTE :
+this does not start the OST read-only, it only disables the
+creation of new objects on the OST. This means existing objects
+can be read, modified, or deleted, but if the OST is new then it
+will not have any such objects.
+.TP
.BI nosvc
Only start the MGC (and MGS, if co-located) for a target service,
and not the actual MDS or OSS service.
#define LMD_FLG_UPDATE 0x2000 /* update parameters */
#define LMD_FLG_HSM 0x4000 /* Start coordinator */
#define LMD_FLG_DEV_RDONLY 0x8000 /* discard modification quitely */
+#define LMD_FLG_NO_PRECREATE 0x10000 /* do not allow OST object creation */
#define lmd_is_client(x) ((x)->lmd_flags & LMD_FLG_CLIENT)
max_t(int, simple_strtoul(s1 + 19, NULL, 10),
time_min);
clear++;
+ } else if (strncmp(s1, "no_precreate", 12) == 0) {
+ lmd->lmd_flags |= LMD_FLG_NO_PRECREATE;
+ clear++;
} else if (strncmp(s1, "noir", 4) == 0) {
lmd->lmd_flags |= LMD_FLG_NOIR; /* test purpose only. */
clear++;
}
lmd = s2lsi(lmi->lmi_sb)->lsi_lmd;
- if (lmd != NULL && lmd->lmd_flags & LMD_FLG_SKIP_LFSCK)
+ if (lmd && lmd->lmd_flags & LMD_FLG_SKIP_LFSCK)
m->ofd_skip_lfsck = 1;
+ if (lmd && lmd->lmd_flags & LMD_FLG_NO_PRECREATE)
+ m->ofd_no_precreate = 1;
+
/* find bottom osd */
OBD_ALLOC(osdname, MTI_NAME_MAXLEN);
if (osdname == NULL)
if (OBD_FAIL_CHECK(OBD_FAIL_OST_EROFS))
RETURN(-EROFS);
+ if (ofd->ofd_no_precreate)
+ return -EPERM;
+
repbody = req_capsule_server_get(tsi->tsi_pill, &RMF_OST_BODY);
if (repbody == NULL)
RETURN(-ENOMEM);
ENTRY;
+ if (ofd->ofd_no_precreate)
+ return -EPERM;
+
ofd_info_init(env, exp);
LASSERT(seq == FID_SEQ_ECHO);
}
run_test 111 "Adding large_dir with over 2GB directory"
+test_112() {
+ start_mds || error "MDS start failed"
+ start_ost || error "OSS start failed"
+ echo "start ost2 service on $(facet_active_host ost2)"
+ start ost2 $(ostdevname 2) $(csa_add "$OST_MOUNT_OPTS" -o no_precreate) ||
+ error "start ost2 facet failed"
+ local val=$(do_facet ost2 \
+ "$LCTL get_param -n obdfilter.$FSNAME-OST0001*.no_precreate")
+ (( $val == 1 )) || error "obdfilter.$FSNAME-OST0001*.no_precreate=$val"
+
+ mount_client $MOUNT || error "mount client failed"
+ wait_osc_import_state client ost2 FULL
+
+ $LFS setstripe -i 0 $DIR/$tfile.0 ||
+ error "problem creating $tfile.0 on OST0000"
+ $LFS setstripe -i 1 $DIR/$tfile.1 && $LFS getstripe $DIR/$tfile.1 &&
+ (( $($LFS getstripe -i $DIR/$tfile.1) == 1 )) &&
+ error "allowed to create $tfile.1 on OST0001"
+ do_facet ost2 $LCTL set_param obdfilter.*.no_precreate=0
+ sleep_maxage
+ $LFS setstripe -i 1 $DIR/$tfile.2 ||
+ error "failed to create $tfile.2 on ost1 facet"
+ stop_ost2 || error "stop ost2 facet failed"
+ cleanup
+}
+run_test 112 "mount OST with nocreate option"
cleanup_115()
{