rc = llcrypt_get_encryption_info(inode);
if (rc)
GOTO(out, rc);
- if (!llcrypt_has_encryption_key(inode))
- GOTO(out, rc = -ENOKEY);
}
} else if (!it_disposition(it, DISP_OPEN_CREATE)) {
/*
rc = llcrypt_get_encryption_info(dir);
if (rc)
GOTO(out_release, rc);
+ encrypt = true;
if (open_flags & O_CREAT) {
/* For migration or mirroring without enc key, we still
* need to be able to create a volatile file.
(open_flags & O_FILE_ENC) != O_FILE_ENC ||
!(open_flags & O_DIRECT)))
GOTO(out_release, rc = -ENOKEY);
- encrypt = true;
}
}
cmp -bl $tmpfile $testfile ||
error "file $testfile is corrupted in memory"
- cancel_lru_locks osc ; cancel_lru_locks mdc
+ remove_enc_key ; insert_enc_key
# check that file read from server is correct
cmp -bl $tmpfile $testfile ||
# decrease size: truncate to PAGE_SIZE
$TRUNCATE $tmpfile $pagesz
$TRUNCATE $testfile $pagesz
- cancel_lru_locks osc ; cancel_lru_locks mdc
+ remove_enc_key ; insert_enc_key
cmp -bl $tmpfile $testfile ||
error "file $testfile is corrupted (1)"
sz=$((pagesz*2))
$TRUNCATE $tmpfile $sz
$TRUNCATE $testfile $sz
- cancel_lru_locks osc ; cancel_lru_locks mdc
+ remove_enc_key ; insert_enc_key
cmp -bl $tmpfile $testfile ||
error "file $testfile is corrupted (2)"
sz=$((pagesz/2))
$TRUNCATE $tmpfile $sz
$TRUNCATE $testfile $sz
- cancel_lru_locks osc ; cancel_lru_locks mdc
+ remove_enc_key ; insert_enc_key
cmp -bl $tmpfile $testfile ||
error "file $testfile is corrupted (3)"
sz=$((sz-7))
$TRUNCATE $tmpfile $sz
$TRUNCATE $testfile $sz
- cancel_lru_locks osc ; cancel_lru_locks mdc
+ remove_enc_key ; insert_enc_key
cmp -bl $tmpfile $testfile ||
error "file $testfile is corrupted (4)"
sz=$((sz+18))
$TRUNCATE $tmpfile $sz
$TRUNCATE $testfile $sz
- cancel_lru_locks osc ; cancel_lru_locks mdc
+ remove_enc_key ; insert_enc_key
cmp -bl $tmpfile $testfile ||
error "file $testfile is corrupted (5)"
sz=$((sz+pagesz+30))
$TRUNCATE $tmpfile $sz
$TRUNCATE $testfile $sz
- cancel_lru_locks osc ; cancel_lru_locks mdc
+ remove_enc_key ; insert_enc_key
cmp -bl $tmpfile $testfile ||
error "file $testfile is corrupted (6)"
rm -f $testfile
- cancel_lru_locks osc ; cancel_lru_locks mdc
+ remove_enc_key ; insert_enc_key
# write hole in file, data spread on MDT and OST
tr '\0' '2' < /dev/zero |
cmp -bl $tmpfile $testfile ||
error "file $testfile is corrupted in memory"
- cancel_lru_locks osc ; cancel_lru_locks mdc
+ remove_enc_key ; insert_enc_key
# check that file read from server is correct
cmp -bl $tmpfile $testfile ||
sz=$((1024*1024+13))
$TRUNCATE $tmpfile $sz
$TRUNCATE $testfile $sz
- cancel_lru_locks osc ; cancel_lru_locks mdc
+ remove_enc_key ; insert_enc_key
cmp -bl $tmpfile $testfile ||
error "file $testfile is corrupted (7)"
sz=7
$TRUNCATE $tmpfile $sz
$TRUNCATE $testfile $sz
- cancel_lru_locks osc ; cancel_lru_locks mdc
+ remove_enc_key ; insert_enc_key
cmp -bl $tmpfile $testfile ||
error "file $testfile is corrupted (8)"
sz=$((1024*1024-13))
$TRUNCATE $tmpfile $sz
$TRUNCATE $testfile $sz
- cancel_lru_locks osc ; cancel_lru_locks mdc
+ remove_enc_key ; insert_enc_key
cmp -bl $tmpfile $testfile ||
error "file $testfile is corrupted (9)"
sz=$((1024*1024+7))
$TRUNCATE $tmpfile $sz
$TRUNCATE $testfile $sz
- cancel_lru_locks osc ; cancel_lru_locks mdc
+ remove_enc_key ; insert_enc_key
cmp -bl $tmpfile $testfile ||
error "file $testfile is corrupted (10)"