switch(cmd) {
case EXT3_IOC_GETFLAGS:
case EXT3_IOC_SETFLAGS:
- RETURN( ll_iocontrol(inode, file, cmd, arg) );
+ RETURN(ll_iocontrol(inode, file, cmd, arg));
case IOC_MDC_LOOKUP: {
struct ptlrpc_request *request = NULL;
struct ll_fid fid;
case LL_IOC_LOV_SETSTRIPE: {
struct ptlrpc_request *request = NULL;
struct mdc_op_data op_data;
- struct iattr attr;
+ struct iattr attr = { 0 };
struct lov_user_md lum, *lump = (struct lov_user_md *)arg;
int rc = 0;
ll_prepare_mdc_op_data(&op_data, inode, NULL, NULL, 0, 0);
- memset(&attr, 0x0, sizeof(attr));
-
LASSERT(sizeof(lum) == sizeof(*lump));
- LASSERT(sizeof(lum.lmm_objects[0])
- == sizeof(lump->lmm_objects[0]));
+ LASSERT(sizeof(lum.lmm_objects[0]) ==
+ sizeof(lump->lmm_objects[0]));
rc = copy_from_user(&lum, lump, sizeof(lum));
if (rc)
return(-EFAULT);
ptlrpc_req_finished(request);
return rc;
- }
+ }
case LL_IOC_LOV_GETSTRIPE: {
struct ptlrpc_request *request = NULL;
struct lov_user_md *lump = (struct lov_user_md *)arg;
CHECKSTAT=${CHECKSTAT:-"checkstat -v"}
CREATETEST=${CREATETEST:-createtest}
-LFIND=${LFIND:-lfind}
-LSTRIPE=${LSTRIPE:-lstripe}
+LFS=${LFS:-lfs}
+LSTRIPE=${LSTRIPE:-"$LFS setstripe"}
+LFIND=${LFIND:-"$LFS find"}
+LVERIFY=${LVERIFY:-ll_dirstripe_verify}
LCTL=${LCTL:-lctl}
MCREATE=${MCREATE:-mcreate}
OPENFILE=${OPENFILE:-openfile}
}
run_test 27k "limit i_blksize for broken user apps ============="
+test_27l() {
+ mcreate $DIR/f27l || error "creating file"
+ $RUNAS $LSTRIPE $DIR/f27l 65536 -1 1 && \
+ error "lstripe should have failed" || true
+}
+run_test 27l "check setstripe permissions (should return error)"
+
test_28() {
mkdir $DIR/d28
$CREATETEST $DIR/d28/ct || error
df $DIR
grep "[0-9]" /proc/fs/lustre/osc/OSC*MNT*/cur*
}
-run_test 64a "verify filter grant calculations (in kernel) ======"
+run_test 64a "verify filter grant calculations (in kernel) ====="
test_64b () {
sh oos.sh $MOUNT
}
-run_test 64b "check out-of-space detection on client ============"
+run_test 64b "check out-of-space detection on client ==========="
# bug 1414 - set/get directories' stripe info
-test_65() {
- LFS=${LFS:-lfs}
- LVERIFY=${LVERIFY:-ll_dirstripe_verify}
-
- echo "dir has no stripe info"
- mkdir $DIR/d65
+test_65a() {
+ mkdir -p $DIR/d65
touch $DIR/d65/f1
- $LVERIFY $DIR/d65 $DIR/d65/f1 || error
+ $LVERIFY $DIR/d65 $DIR/d65/f1 || error "lverify failed"
+}
+run_test 65a "directory with no stripe info ===================="
- echo "setstripe $(($STRIPESIZE * 2)) 0 1"
- $LFS setstripe $DIR/d65 $(($STRIPESIZE * 2)) 0 1 || error
+test_65b() {
+ mkdir -p $DIR/d65
+ $LSTRIPE $DIR/d65 $(($STRIPESIZE * 2)) 0 1 || error "setstripe"
touch $DIR/d65/f2
- $LVERIFY $DIR/d65 $DIR/d65/f2 || error
+ $LVERIFY $DIR/d65 $DIR/d65/f2 || error "lverify failed"
+}
+run_test 65b "directory setstripe $(($STRIPESIZE * 2)) 0 1 ==============="
- if [ $ostcount -gt 1 ]; then
- echo "setstripe $(($STRIPESIZE * 4)) 1 $(($OSTCOUNT - 1))"
- $LFS setstripe $DIR/d65 $(($STRIPESIZE * 4)) 1 \
- $(($OSTCOUNT - 1)) || error
+test_65c() {
+ if [ $OSTCOUNT -gt 1 ]; then
+ mkdir -p $DIR/d65
+ $LSTRIPE DIR/d65 $(($STRIPESIZE * 4)) 1 \
+ $(($OSTCOUNT - 1)) || error "setstripe"
touch $DIR/d65/f3
- $LVERIFY $DIR/d65 $DIR/d65/f3 || error
+ $LVERIFY $DIR/d65 $DIR/d65/f3 || error "lverify failed"
fi
+}
+run_test 65c "directory setstripe $(($STRIPESIZE * 4)) 1 $(($OSTCOUNT - 1))"
- [ $STRIPECOUNT -eq 0 ] && sc=1 || sc=$(($STRIPECOUNT - 1))
+[ $STRIPECOUNT -eq 0 ] && sc=1 || sc=$(($STRIPECOUNT - 1))
- echo "setstripe $STRIPESIZE -1 $sc"
- $LFS setstripe $DIR/d65 $STRIPESIZE -1 $sc || error
+test_65d() {
+ mkdir -p $DIR/d65
+ $LSTRIPE $DIR/d65 $STRIPESIZE -1 $sc || error "setstripe"
touch $DIR/d65/f4 $DIR/d65/f5
- $LVERIFY $DIR/d65 $DIR/d65/f4 $DIR/d65/f5 || error
+ $LVERIFY $DIR/d65 $DIR/d65/f4 $DIR/d65/f5 || error "lverify failed"
+}
+run_test 65d "directory setstripe $STRIPESIZE -1 $sc ======================"
- echo "setstripe 0 -1 0 (default)"
- $LFS setstripe $DIR/d65 0 -1 0 || error
+test_65e() {
+ mkdir -p $DIR/d65
+ $LSTRIPE $DIR/d65 0 -1 0 || error "setstripe"
touch $DIR/d65/f6
- $LVERIFY $DIR/d65 $DIR/d65/f6 || error
+ $LVERIFY $DIR/d65 $DIR/d65/f6 || error "lverify failed"
+}
+run_test 65e "directory setstripe 0 -1 0 (default) ============="
+
+test_65f() {
+ mkdir -p $DIR/d65f
+ $RUNAS $LSTRIPE $DIR/d65f 0 -1 0 && error "setstripe succeeded" || true
}
-run_test 65 "Verify that the files are created using parent dir's stripe info"
+run_test 65f "dir setstripe permission (should return error) ==="
# bug 2543 - update blocks count on client
test_66() {