On Tue, Aug 08, 2023 at 01:08:03PM -0400, Sweet Tea Dorminy wrote: > +static int find_mode_prepared_key(struct fscrypt_info *ci, > + struct fscrypt_master_key *mk, > + struct fscrypt_prepared_key *keys, > + u8 hkdf_context, bool include_fs_uuid) > +{ > + struct fscrypt_mode *mode = ci->ci_mode; > + const u8 mode_num = mode - fscrypt_modes; > + struct fscrypt_prepared_key *prep_key; > + int err; > + > + if (WARN_ON_ONCE(mode_num > FSCRYPT_MODE_MAX)) > + return -EINVAL; > + > + prep_key = &keys[mode_num]; > + if (fscrypt_is_key_prepared(prep_key, ci)) { > + ci->ci_enc_key = *prep_key; > + return 0; > + } > + err = setup_new_mode_prepared_key(mk, prep_key, ci, hkdf_context, > + include_fs_uuid); > + if (err) > + return err; > + > + ci->ci_enc_key = *prep_key; > + return 0; > +} Any thoughts about the feedback I gave about this on v2 (https://lore.kernel.org/linux-fscrypt/20230411032935.GC47625@sol.localdomain/)? The new naming with "find" seems wrong. - Eric