Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1639039

Re: [PATCH 16/16] fs: switch ->s_uuid to uuid_t

From Amir Goldstein <amir73il@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 16/16] fs: switch ->s_uuid to uuid_t
Date 2017-05-10 21:10 +0200
Message-ID <tFF9L-4yf-5@gated-at.bofh.it> (permalink)
References <tFEdH-40t-3@gated-at.bofh.it> <tFEdI-40t-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, May 10, 2017 at 9:02 PM, Christoph Hellwig <hch@lst.de> wrote:
> For some file systems we still memcpy into it, but in various places this
> already allows us to use the proper uuid helpers.  More to come..
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---

Series looks good!

My main concern is that filesystems with char uuid[16] are here to stay,
or maybe, will be converted slowly.

Considering this, perhaps we should have a helper/macro to copy from
char[16] to *uuid_t and maybe  BUILD_BUG_ON the size comparison?
#define bytes_to_uuid(dst, src) ...


> diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
> index 682b336a7a6a..93a420160964 100644
> --- a/fs/xfs/xfs_mount.c
> +++ b/fs/xfs/xfs_mount.c
> @@ -75,7 +75,7 @@ xfs_uuid_mount(
>
>         /* Publish UUID in struct super_block */
>         BUILD_BUG_ON(sizeof(mp->m_super->s_uuid) != sizeof(uuid_t));

This BUILD_BUG is no longer needed.

> -       memcpy(&mp->m_super->s_uuid, uuid, sizeof(uuid_t));
> +       uuid_copy(&mp->m_super->s_uuid, uuid);
>
>         if (mp->m_flags & XFS_MOUNT_NOUUID)
>                 return 0;
[...]

> diff --git a/security/integrity/evm/evm_crypto.c b/security/integrity/evm/evm_crypto.c
> index d7f282d75cc1..1d32cd20009a 100644
> --- a/security/integrity/evm/evm_crypto.c
> +++ b/security/integrity/evm/evm_crypto.c
> @@ -164,7 +164,7 @@ static void hmac_add_misc(struct shash_desc *desc, struct inode *inode,
>         hmac_misc.mode = inode->i_mode;
>         crypto_shash_update(desc, (const u8 *)&hmac_misc, sizeof(hmac_misc));
>         if (evm_hmac_attrs & EVM_ATTR_FSUUID)
> -               crypto_shash_update(desc, inode->i_sb->s_uuid,
> +               crypto_shash_update(desc, &inode->i_sb->s_uuid.b[0],

I wonder if 'inode->i_sb->s_uuid.b' would have been better here

Cheers,
Amir.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

cleanup UUID types Christoph Hellwig <hch@lst.de> - 2017-05-10 20:10 +0200
  [PATCH 04/16] uuid: don't export guid_index and uuid_index Christoph Hellwig <hch@lst.de> - 2017-05-10 20:10 +0200
  [PATCH 03/16] uuid: rename uuid types Christoph Hellwig <hch@lst.de> - 2017-05-10 20:10 +0200
    Re: [PATCH 03/16] uuid: rename uuid types David Howells <dhowells@redhat.com> - 2017-05-10 20:30 +0200
      Re: [PATCH 03/16] uuid: rename uuid types Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-05-11 13:40 +0200
    Re: [PATCH 03/16] uuid: rename uuid types Amir Goldstein <amir73il@gmail.com> - 2017-05-10 21:20 +0200
      Re: [PATCH 03/16] uuid: rename uuid types Christoph Hellwig <hch@lst.de> - 2017-05-11 10:00 +0200
        Re: [PATCH 03/16] uuid: rename uuid types Amir Goldstein <amir73il@gmail.com> - 2017-05-11 10:40 +0200
  [PATCH 02/16] xfs: use uuid_be to implement the uuid_t type Christoph Hellwig <hch@lst.de> - 2017-05-10 20:10 +0200
  [PATCH 06/16] afs: switch to use uuid_t and uuid_gen Christoph Hellwig <hch@lst.de> - 2017-05-10 20:10 +0200
    Re: [PATCH 06/16] afs: switch to use uuid_t and uuid_gen David Howells <dhowells@redhat.com> - 2017-05-10 20:30 +0200
  [PATCH 16/16] fs: switch ->s_uuid to uuid_t Christoph Hellwig <hch@lst.de> - 2017-05-10 20:10 +0200
    Re: [PATCH 16/16] fs: switch ->s_uuid to uuid_t Amir Goldstein <amir73il@gmail.com> - 2017-05-10 21:10 +0200
      Re: [PATCH 16/16] fs: switch ->s_uuid to uuid_t Christoph Hellwig <hch@lst.de> - 2017-05-11 10:00 +0200
  [PATCH 13/16] block: remove blk_part_pack_uuid Christoph Hellwig <hch@lst.de> - 2017-05-10 20:10 +0200
  [PATCH 14/16] block: remove blk_part_pack_uuid Christoph Hellwig <hch@lst.de> - 2017-05-10 20:10 +0200
    Re: [PATCH 14/16] block: remove blk_part_pack_uuid Christoph Hellwig <hch@lst.de> - 2017-05-10 20:20 +0200
  [PATCH 05/16] uuid: add the v1 layout to uuid_t Christoph Hellwig <hch@lst.de> - 2017-05-10 20:10 +0200
    Re: [PATCH 05/16] uuid: add the v1 layout to uuid_t David Howells <dhowells@redhat.com> - 2017-05-10 20:30 +0200
    Re: [PATCH 05/16] uuid: add the v1 layout to uuid_t Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2017-05-11 13:50 +0200
      Re: [PATCH 05/16] uuid: add the v1 layout to uuid_t Christoph Hellwig <hch@lst.de> - 2017-05-11 14:10 +0200
  [PATCH 01/16] xfs: use uuid_copy() helper to abstract uuid_t Christoph Hellwig <hch@lst.de> - 2017-05-10 20:10 +0200
  [PATCH 09/16] md: namespace private helper names Christoph Hellwig <hch@lst.de> - 2017-05-10 20:10 +0200
  [PATCH 12/16] xfs: use the common helper uuid_is_null() Christoph Hellwig <hch@lst.de> - 2017-05-10 20:10 +0200
  [PATCH 08/16] xfs: remove uuid_getnodeuniq and xfs_uu_t Christoph Hellwig <hch@lst.de> - 2017-05-10 20:10 +0200
  [PATCH 10/16] uuid: hoist helpers uuid_equal() and uuid_copy() from xfs Christoph Hellwig <hch@lst.de> - 2017-05-10 20:10 +0200
  [PATCH 11/16] uuid: hoist uuid_is_null() helper from libnvdimm Christoph Hellwig <hch@lst.de> - 2017-05-10 20:10 +0200

csiph-web