Whamcloud - gitweb
LU-16091 enc: S_ENCRYPTED flag on OST objects for enc files
[fs/lustre-release.git] / lustre / osc / osc_request.c
index 580e4d4..194e8cd 100644 (file)
@@ -1780,6 +1780,16 @@ no_bulk:
        else /* short io */
                ioobj_max_brw_set(ioobj, 0);
 
+       if (inode && IS_ENCRYPTED(inode) &&
+           llcrypt_has_encryption_key(inode) &&
+           !OBD_FAIL_CHECK(OBD_FAIL_LFSCK_NO_ENCFLAG)) {
+               if ((body->oa.o_valid & OBD_MD_FLFLAGS) == 0) {
+                       body->oa.o_valid |= OBD_MD_FLFLAGS;
+                       body->oa.o_flags = 0;
+               }
+               body->oa.o_flags |= LUSTRE_ENCRYPT_FL;
+       }
+
        if (short_io_size != 0) {
                if ((body->oa.o_valid & OBD_MD_FLFLAGS) == 0) {
                        body->oa.o_valid |= OBD_MD_FLFLAGS;