Whamcloud - gitweb
LU-16695 llite: switch to ki_flags from f_flags
[fs/lustre-release.git] / lustre / llite / llite_lib.c
index 7a060e6..34f083a 100644 (file)
@@ -2362,13 +2362,15 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr,
                                /* Call to ll_io_zero_page is not necessary if
                                 * truncating on PAGE_SIZE boundary, because
                                 * whole pages will be wiped.
-                                * In case of Direct IO, all we need is to set
-                                * new size.
+                                *
+                                * an exception is when working with the
+                                * raw ciphertext - in that case, we need to
+                                * encrypt those zeroes
                                 */
                                if (attr->ia_valid & ATTR_SIZE &&
                                    attr->ia_size & ~PAGE_MASK &&
                                    !(attr->ia_valid & ATTR_FILE &&
-                                     attr->ia_file->f_flags & O_DIRECT)) {
+                                     attr->ia_file->f_flags & O_CIPHERTEXT)) {
                                        pgoff_t offset =
                                                attr->ia_size & (PAGE_SIZE - 1);