From: Christoph Hellwig Date: Thu, 27 Feb 2020 01:30:44 +0000 (-0800) Subject: xfs: clean up bufsize alignment in xfs_ioc_attr_list X-Git-Tag: microblaze-v5.10~1020^2~91 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=f311d771a090f5cc96b65ab76737cbf13914bc0c;p=linux-2.6-microblaze.git xfs: clean up bufsize alignment in xfs_ioc_attr_list Use the round_down macro, and use the size of the uint32 type we use in the callback that fills the buffer to make the code a little more clear - the size of it is always the same as int for platforms that Linux runs on. Suggested-by: Dave Chinner Reviewed-by: Dave Chinner Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 2af73d664613..ef8e378c42cb 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -415,7 +415,7 @@ xfs_ioc_attr_list( context.resynch = 1; context.attr_filter = xfs_attr_filter(flags); context.buffer = buffer; - context.bufsize = (bufsize & ~(sizeof(int)-1)); /* align */ + context.bufsize = round_down(bufsize, sizeof(uint32_t)); context.firstu = context.bufsize; context.put_listent = xfs_ioc_attr_put_listent;