Re: [PATCH v2] ceph: do not print the whole xattr value if it's too long

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 1, 2023 at 2:19 AM <xiubli@xxxxxxxxxx> wrote:
>
> From: Xiubo Li <xiubli@xxxxxxxxxx>
>
> If the xattr's value size is long enough the kernel will warn and
> then will fail the xfstests test case.
>
> Just print part of the value string if it's too long.
>
> Cc: stable@xxxxxxxxxxxxxxx
> URL: https://tracker.ceph.com/issues/58404

Hi Xiubo,

Does this really need to go to stable kernels?  None of the douts are
printed by default.

> Signed-off-by: Xiubo Li <xiubli@xxxxxxxxxx>
> ---
>
> V2:
> - switch to use min() from Jeff's comment
> - s/XATTR_MAX_VAL/MAX_XATTR_VAL/g
>
>
>  fs/ceph/xattr.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c
> index b10d459c2326..887a65279fcf 100644
> --- a/fs/ceph/xattr.c
> +++ b/fs/ceph/xattr.c
> @@ -561,6 +561,7 @@ static struct ceph_vxattr *ceph_match_vxattr(struct inode *inode,
>         return NULL;
>  }
>
> +#define MAX_XATTR_VAL 256

Perhaps MAX_XATTR_VAL_PRINT_LEN?  Also, I'd add a blank like after the
define -- it's used by more than one function.

Thanks,

                Ilya




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux