Skip to content

Commit

Permalink
loadpin: stop using bdevname
Browse files Browse the repository at this point in the history
Use the %pg format specifier to save on stack consuption and code size.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220512062014.1826835-1-hch@lst.de
  • Loading branch information
Christoph Hellwig authored and kees committed May 16, 2022
1 parent a5f4d9d commit ed5edd5
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions security/loadpin/loadpin.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,8 @@ static void check_pinning_enforcement(struct super_block *mnt_sb)
* device, allow sysctl to change modes for testing.
*/
if (mnt_sb->s_bdev) {
char bdev[BDEVNAME_SIZE];

ro = bdev_read_only(mnt_sb->s_bdev);
bdevname(mnt_sb->s_bdev, bdev);
pr_info("%s (%u:%u): %s\n", bdev,
pr_info("%pg (%u:%u): %s\n", mnt_sb->s_bdev,
MAJOR(mnt_sb->s_bdev->bd_dev),
MINOR(mnt_sb->s_bdev->bd_dev),
ro ? "read-only" : "writable");
Expand Down

0 comments on commit ed5edd5

Please sign in to comment.