RETURN(rc);
}
+ ia_valid = op_data->op_attr.ia_valid;
+ /* inode size will be in ll_setattr_ost, can't do it now since dirty
+ * cache is not cleared yet. */
+ op_data->op_attr.ia_valid &= ~(TIMES_SET_FLAGS | ATTR_SIZE);
+ rc = simple_setattr(dentry, &op_data->op_attr);
+ op_data->op_attr.ia_valid = ia_valid;
+
/* Extract epoch data if obtained. */
op_data->op_handle = md.body->handle;
op_data->op_ioepoch = md.body->ioepoch;
struct ll_inode_info *lli = ll_i2info(inode);
struct md_op_data *op_data = NULL;
struct md_open_data *mod = NULL;
- unsigned int valid = attr->ia_valid;
int rc = 0, rc1 = 0;
ENTRY;
rc = ll_setattr_ost(inode, attr);
EXIT;
out:
- if (rc == 0) {
- /* Update inode attribute after dirty cache is cleaned
- * by truncating OST objects. */
- attr->ia_valid |= ATTR_FORCE;
- rc = simple_setattr(dentry, attr);
- LASSERT(rc == 0);
- }
if (op_data) {
if (op_data->op_ioepoch) {
rc1 = ll_setattr_done_writing(inode, op_data, mod);
ll_stats_ops_tally(ll_i2sbi(inode), (attr->ia_valid & ATTR_SIZE) ?
LPROC_LL_TRUNC : LPROC_LL_SETATTR, 1);
- attr->ia_valid = valid;
- RETURN(rc);
+ return rc;
}
int ll_setattr(struct dentry *de, struct iattr *attr)
LASSERTF(0, "invalid type %d\n", io->ci_type);
case CIT_MISC:
case CIT_FSYNC:
- case CIT_SETATTR:
result = +1;
break;
+ case CIT_SETATTR:
case CIT_READ:
case CIT_WRITE:
case CIT_FAULT:
" D open(O_DIRECTORY)\n"
" f statfs\n"
" F print FID\n"
+" H[num] create HSM released file with num stripes\n"
" G gid get grouplock\n"
" g gid put grouplock\n"
" K link path to filename\n"
}
run_test 228c "NOT shrink the last entry in OI index node to recycle idle leaf"
-test_229() { # LU-2482
+test_229() { # LU-2482, LU-3448
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
+ [ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return
+
+ rm -f $DIR/$tfile
- # Create a file with a release layout (stripe count = 0)
+ # Create a file with a released layout and stripe count 2.
$MULTIOP $DIR/$tfile H2c ||
- error "failed to create file w. released layout"
+ error "failed to create file with released layout"
$GETSTRIPE -v $DIR/$tfile
[ $stripe_count -eq 2 ] || error "stripe count not 2 ($stripe_count)"
stat $DIR/$tfile || error "failed to stat released file"
- $TRUNCATE $DIR/$tfile 200000
- $CHECKSTAT -s 200000 $DIR/$tfile || error
+ # Truncate should fail.
+ $TRUNCATE $DIR/$tfile 200000 &&
+ error "truncate of released file should fail"
+
+ # Ensure that nothing happened anyway.
+ $CHECKSTAT -s 0 $DIR/$tfile ||
+ error "released file size should not change"
# Stripe count should be no change after truncate
stripe_count=$($GETSTRIPE -c $DIR/$tfile) || error "getstripe failed"
rm $DIR/$tfile || error "failed to remove released file"
}
-run_test 229 "getstripe/stat/rm work on released files (stripe count = 0)"
+run_test 229 "getstripe/stat/rm work on released files (stripe count = 2)"
test_230a() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return