Now that we moved fsverity out of struct inode update the comments to not imply that it's still located in there. Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx> --- fs/verity/enable.c | 6 +++--- fs/verity/fsverity_private.h | 9 +++++---- fs/verity/open.c | 12 ++++++------ include/linux/fsverity.h | 12 +++++++----- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/fs/verity/enable.c b/fs/verity/enable.c index c284f46d1b53..760824611abc 100644 --- a/fs/verity/enable.c +++ b/fs/verity/enable.c @@ -287,9 +287,9 @@ static int enable_verity(struct file *filp, /* Successfully enabled verity */ /* - * Readers can start using ->i_verity_info immediately, so it - * can't be rolled back once set. So don't set it until just - * after the filesystem has successfully enabled verity. + * Readers can start using the inode's verity info immediately, + * so it can't be rolled back once set. So don't set it until + * just after the filesystem has successfully enabled verity. */ fsverity_set_info(inode, vi); } diff --git a/fs/verity/fsverity_private.h b/fs/verity/fsverity_private.h index b3506f56e180..1b45dc5f52cc 100644 --- a/fs/verity/fsverity_private.h +++ b/fs/verity/fsverity_private.h @@ -58,10 +58,11 @@ struct merkle_tree_params { * fsverity_info - cached verity metadata for an inode * * When a verity file is first opened, an instance of this struct is allocated - * and stored in ->i_verity_info; it remains until the inode is evicted. It - * caches information about the Merkle tree that's needed to efficiently verify - * data read from the file. It also caches the file digest. The Merkle tree - * pages themselves are not cached here, but the filesystem may cache them. + * and stored in inode's verity pointer; it remains until the inode is evicted. + * It caches information about the Merkle tree that's needed to efficiently + * verify data read from the file. It also caches the file digest. The Merkle + * tree pages themselves are not cached here, but the filesystem may cache + * them. */ struct fsverity_info { struct merkle_tree_params tree_params; diff --git a/fs/verity/open.c b/fs/verity/open.c index 0dcd33f00361..c4a0c94dde2c 100644 --- a/fs/verity/open.c +++ b/fs/verity/open.c @@ -251,10 +251,10 @@ struct fsverity_info *fsverity_create_info(const struct inode *inode, void fsverity_set_info(struct inode *inode, struct fsverity_info *vi) { /* - * Multiple tasks may race to set ->i_verity_info, so use + * Multiple tasks may race to set the inode's verity info, so use * cmpxchg_release(). This pairs with the smp_load_acquire() in - * fsverity_get_info(). I.e., here we publish ->i_verity_info with a - * RELEASE barrier so that other tasks can ACQUIRE it. + * fsverity_get_info(). I.e., here we publish the inode's verity info + * with a RELEASE barrier so that other tasks can ACQUIRE it. */ VFS_WARN_ON_ONCE(!inode->i_sb->s_vop); VFS_WARN_ON_ONCE(!inode->i_sb->s_vop->inode_info_offs); @@ -262,8 +262,8 @@ void fsverity_set_info(struct inode *inode, struct fsverity_info *vi) /* Lost the race, so free the fsverity_info we allocated. */ fsverity_free_info(vi); /* - * Afterwards, the caller may access ->i_verity_info directly, - * so make sure to ACQUIRE the winning fsverity_info. + * Afterwards, the caller may access the inode's verity info + * directly, so make sure to ACQUIRE the winning fsverity_info. */ (void)fsverity_get_info(inode); } @@ -359,7 +359,7 @@ int fsverity_get_descriptor(struct inode *inode, return 0; } -/* Ensure the inode has an ->i_verity_info */ +/* Ensure the inode has fsverity info set */ static int ensure_verity_info(struct inode *inode) { struct fsverity_info *vi = fsverity_get_info(inode); diff --git a/include/linux/fsverity.h b/include/linux/fsverity.h index 0ee5b2fea389..9e204d5c5691 100644 --- a/include/linux/fsverity.h +++ b/include/linux/fsverity.h @@ -145,7 +145,7 @@ static inline struct fsverity_info *fsverity_get_info(const struct inode *inode) /* * Pairs with the cmpxchg_release() in fsverity_set_info(). - * I.e., another task may publish ->i_verity_info concurrently, + * I.e., another task may publish the inode's verity info concurrently, * executing a RELEASE barrier. We need to use smp_load_acquire() here * to safely ACQUIRE the memory the other task published. */ @@ -174,7 +174,8 @@ void __fsverity_cleanup_inode(struct inode *inode); * fsverity_cleanup_inode() - free the inode's verity info, if present * @inode: an inode being evicted * - * Filesystems must call this on inode eviction to free ->i_verity_info. + * Filesystems must call this on inode eviction to free -the inode's + * verity info. */ static inline void fsverity_cleanup_inode(struct inode *inode) { @@ -285,12 +286,13 @@ static inline bool fsverity_verify_page(struct page *page) * fsverity_active() - do reads from the inode need to go through fs-verity? * @inode: inode to check * - * This checks whether ->i_verity_info has been set. + * This checks whether the inode's verity info has been set. * * Filesystems call this from ->readahead() to check whether the pages need to * be verified or not. Don't use IS_VERITY() for this purpose; it's subject to * a race condition where the file is being read concurrently with - * FS_IOC_ENABLE_VERITY completing. (S_VERITY is set before ->i_verity_info.) + * FS_IOC_ENABLE_VERITY completing. (S_VERITY is set before the inode's + * verity info.) * * Return: true if reads need to go through fs-verity, otherwise false */ @@ -305,7 +307,7 @@ static inline bool fsverity_active(const struct inode *inode) * @filp: the struct file being set up * * When opening a verity file, deny the open if it is for writing. Otherwise, - * set up the inode's ->i_verity_info if not already done. + * set up the inode's verity info if not already done. * * When combined with fscrypt, this must be called after fscrypt_file_open(). * Otherwise, we won't have the key set up to decrypt the verity metadata. -- 2.47.2