size_t nob = io->ci_nob;
struct iov_iter iter;
size_t written = 0;
- int chunk_size;
- /* this i_size_read() is potentially racy, but it should be mostly
- * reliable and this is just a temporary workaround for the compression
- * preview
- */
- loff_t inode_size = i_size_read(inode);
- bool write_beyond_eof = false;
ENTRY;
file_dentry(file)->d_name.name,
pos, pos + cnt);
- if (pos >= inode_size)
- write_beyond_eof = true;
-
- chunk_size = (1 << (io->ci_max_compr_chunk_bits + 16));
-
- /* compressed files require chunk-aligned writes for overwrites
- * writes at EOF are OK because they do not update existing data
- * EX-7601
- */
- if (io->ci_compressed_file && !write_beyond_eof &&
- (pos % chunk_size || cnt % chunk_size)) {
- CERROR("Compression preview requires writes to be chunk size aligned or at EOF, write pos: %llu, bytes: %lu, chunk_size: %d, inode_size %llu\n",
- pos, cnt, chunk_size, inode_size);
- RETURN(-EINVAL);
- }
-
/* The maximum Lustre file size is variable, based on the OST maximum
* object size and number of stripes. This needs another check in
* addition to the VFS checks earlier. */
}
run_test 460b "Try to compress with wrong algo"
-# This test verifies the write restrictions for the preview version related to
-# EX-7601, this test will be removed once EX-7601 is resolved
-# Restrictions are as follows:
-# Chunk aligned writes are always allowed
-# Non-chunk-aligned writes are only allowed if they are extending the file, ie,
-# if they are not overwriting existing data
+# This test for EX-7601 write restrictions is being retained temporarily so we
+# can test overwrites in this way - we'll have better tests later
test_460c() {
(( MDS1_VERSION >= $(version_code 2.14.0.91) )) ||
skip "Need MDS version at least 2.14.0.91"
error "aligned dd to overwrite $stored failed"
# Cannot do non-chunk aligned IO when overwriting
- dd if=/dev/zero of=$stored bs=37K count=5 conv=notrunc &&
+ dd if=/dev/zero of=$stored bs=37K count=5 conv=notrunc ||
error "unsafe dd to $stored succeeded"
# Cannot do non-chunk aligned IO when overwriting (test larger size)
- dd if=/dev/zero of=$stored bs=1025K count=5 conv=notrunc &&
+ dd if=/dev/zero of=$stored bs=1025K count=5 conv=notrunc ||
error "unsafe dd to $stored succeeded"
# Can do non-chunk aligned IO when extending the file