On 07/12/17 12:32, Andrew Price wrote:
On 07/12/17 12:02, Steven Whitehouse wrote:
--- a/include/uapi/linux/gfs2_ondisk.h
+++ b/include/uapi/linux/gfs2_ondisk.h
@@ -197,8 +197,9 @@ struct gfs2_rgrp {
      __be64 rg_data0;     /* First data location */
      __be32 rg_data;      /* Number of data blocks in rgrp */
      __be32 rg_bitbytes;  /* Number of bytes in data bitmaps */
+    __be32 rg_crc;       /* crc32 of the structure with this field 0 */
In this case because rg_crc is followed by another structure element, if that element is 64 bit aligned, then there might be a gap here. Worth checking that the overall structure size has not changed, and might be worth adding an explicit 32 bit pad field to pair up with the crc too, and reducing the reserved field by another 4 bytes.

sizeof(struct gfs2_rgrp) is 128 before and after the change, which I would expect as rg_reserved doesn't require 64-bit alignment. I can add a padding field as documentation though.

Thinking about this again, adding a padding field like this would need special casing in the rgrp_in and out functions so I'm not sure it's worth making that change.

Andy

Reply via email to