{
struct ccc_io *vio = cl2ccc_io(env, ios);
struct cl_io *io = ios->cis_io;
- size_t new_size = io->u.ci_truncate.tr_size;
+ loff_t new_size = io->u.ci_truncate.tr_size;
__u32 enqflags = new_size == 0 ? CEF_DISCARD_DATA : 0;
int result;
struct cl_io *io = ios->cis_io;
struct inode *inode = ccc_object_inode(io->ci_obj);
struct cl_object *obj = ios->cis_obj;
- size_t size = io->u.ci_truncate.tr_size;
+ loff_t size = io->u.ci_truncate.tr_size;
pgoff_t start = cl_index(obj, size);
int result;
struct vvp_io *vio = cl2vvp_io(env, ios);
struct cl_io *io = ios->cis_io;
struct inode *inode = ccc_object_inode(io->ci_obj);
- size_t size = io->u.ci_truncate.tr_size;
+ loff_t size = io->u.ci_truncate.tr_size;
if (vio->cui_partpage != NULL) {
cl_page_disown(env, ios->cis_io, vio->cui_partpage);
switch(io->ci_type) {
case CIT_TRUNC: {
- size_t new_size = parent->u.ci_truncate.tr_size;
+ loff_t new_size = parent->u.ci_truncate.tr_size;
new_size = lov_size_to_stripe(lsm, new_size, stripe);
io->u.ci_truncate.tr_capa = parent->u.ci_truncate.tr_capa;
}
run_test 34f "read from a file with no objects until EOF ======="
+test_34g() {
+ dd if=/dev/zero of=$DIR/$tfile bs=1 count=100 seek=$TEST_34_SIZE || error
+ $TRUNCATE $DIR/$tfile $((TEST_34_SIZE / 2))|| error
+ $CHECKSTAT -s $((TEST_34_SIZE / 2)) $DIR/$tfile || error "truncate failed"
+ cancel_lru_locks osc
+ $CHECKSTAT -s $((TEST_34_SIZE / 2)) $DIR/$tfile || \
+ error "wrong size after lock cancel"
+
+ $TRUNCATE $DIR/$tfile $TEST_34_SIZE || error
+ $CHECKSTAT -s $TEST_34_SIZE $DIR/$tfile || \
+ error "expanding truncate failed"
+ cancel_lru_locks osc
+ $CHECKSTAT -s $TEST_34_SIZE $DIR/$tfile || \
+ error "wrong expanded size after lock cancel"
+}
+run_test 34g "truncate long file ==============================="
+
test_35a() {
cp /bin/sh $DIR/f35a
chmod 444 $DIR/f35a