]> git.apps.os.sepia.ceph.com Git - ceph-client.git/commitdiff
ceph: update WARN_ON message to pr_warn
authorJeff Layton <jlayton@kernel.org>
Thu, 31 Mar 2022 18:47:26 +0000 (14:47 -0400)
committerJeff Layton <jlayton@kernel.org>
Tue, 31 May 2022 15:50:00 +0000 (11:50 -0400)
Give some more helpful info

Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
fs/ceph/caps.c

index 5ab9d7348eec41f92b7b914e7fcb8e88a0bbf95a..489ca530fc5ba9cf7c5ad5f4a3c571777ba623ae 100644 (file)
@@ -3497,10 +3497,13 @@ static void handle_cap_grant(struct inode *inode,
                dout("%p mode 0%o uid.gid %d.%d\n", inode, inode->i_mode,
                     from_kuid(&init_user_ns, inode->i_uid),
                     from_kgid(&init_user_ns, inode->i_gid));
-
-               WARN_ON_ONCE(ci->fscrypt_auth_len != extra_info->fscrypt_auth_len ||
-                            memcmp(ci->fscrypt_auth, extra_info->fscrypt_auth,
-                                    ci->fscrypt_auth_len));
+#if IS_ENABLED(CONFIG_FS_ENCRYPTION)
+               if (ci->fscrypt_auth_len != extra_info->fscrypt_auth_len ||
+                   memcmp(ci->fscrypt_auth, extra_info->fscrypt_auth,
+                          ci->fscrypt_auth_len))
+                       pr_warn_ratelimited("%s: cap grant attempt to change fscrypt_auth on non-I_NEW inode (old len %d new len %d)\n",
+                               __func__, ci->fscrypt_auth_len, extra_info->fscrypt_auth_len);
+#endif
        }
 
        if ((newcaps & CEPH_CAP_LINK_SHARED) &&