)]}'
{
  "commit": "a32744d4abae24572eff7269bc17895c41bd0085",
  "tree": "b384f580af75b17ede3fd830b7ad5276d0036ac0",
  "parents": [
    "b52b80023f262ce8a0ffdcb490acb23e8678377a"
  ],
  "author": {
    "name": "Ian Kent",
    "email": "raven@themaw.net",
    "time": "Wed Feb 22 20:45:44 2012 +0800"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Sat Feb 25 12:10:27 2012 -0800"
  },
  "message": "autofs: work around unhappy compat problem on x86-64\n\nWhen the autofs protocol version 5 packet type was added in commit\n5c0a32fc2cd0 (\"autofs4: add new packet type for v5 communications\"), it\nobvously tried quite hard to be word-size agnostic, and uses explicitly\nsized fields that are all correctly aligned.\n\nHowever, with the final \"char name[NAME_MAX+1]\" array at the end, the\nactual size of the structure ends up being not very well defined:\nbecause the struct isn\u0027t marked \u0027packed\u0027, doing a \"sizeof()\" on it will\nalign the size of the struct up to the biggest alignment of the members\nit has.\n\nAnd despite all the members being the same, the alignment of them is\ndifferent: a \"__u64\" has 4-byte alignment on x86-32, but native 8-byte\nalignment on x86-64.  And while \u0027NAME_MAX+1\u0027 ends up being a nice round\nnumber (256), the name[] array starts out a 4-byte aligned.\n\nEnd result: the \"packed\" size of the structure is 300 bytes: 4-byte, but\nnot 8-byte aligned.\n\nAs a result, despite all the fields being in the same place on all\narchitectures, sizeof() will round up that size to 304 bytes on\narchitectures that have 8-byte alignment for u64.\n\nNote that this is *not* a problem for 32-bit compat mode on POWER, since\nthere __u64 is 8-byte aligned even in 32-bit mode.  But on x86, 32-bit\nand 64-bit alignment is different for 64-bit entities, and as a result\nthe structure that has exactly the same layout has different sizes.\n\nSo on x86-64, but no other architecture, we will just subtract 4 from\nthe size of the structure when running in a compat task.  That way we\nwill write the properly sized packet that user mode expects.\n\nNot pretty.  Sadly, this very subtle, and unnecessary, size difference\nhas been encoded in user space that wants to read packets of *exactly*\nthe right size, and will refuse to touch anything else.\n\nReported-and-tested-by: Thomas Meyer \u003cthomas@m3y3r.de\u003e\nSigned-off-by: Ian Kent \u003craven@themaw.net\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "d8d8e7ba6a1e1bf52c367a73514aeaa202b8fcea",
      "old_mode": 33188,
      "old_path": "fs/autofs4/autofs_i.h",
      "new_id": "eb1cc92cd67d26d2966fa1191bb373f646144583",
      "new_mode": 33188,
      "new_path": "fs/autofs4/autofs_i.h"
    },
    {
      "type": "modify",
      "old_id": "76741d8d77866496496115312f6831b85cc51570",
      "old_mode": 33188,
      "old_path": "fs/autofs4/dev-ioctl.c",
      "new_id": "85f1fcdb30e75b4ad2da3d2dd8c1286664b6a3dd",
      "new_mode": 33188,
      "new_path": "fs/autofs4/dev-ioctl.c"
    },
    {
      "type": "modify",
      "old_id": "e16980b00b8d7315dda8d7b92d93fdaf7062e843",
      "old_mode": 33188,
      "old_path": "fs/autofs4/inode.c",
      "new_id": "06858d955120ed43fab44309f1bc978f11c24124",
      "new_mode": 33188,
      "new_path": "fs/autofs4/inode.c"
    },
    {
      "type": "modify",
      "old_id": "da8876d38a7b7e3a50101f02817cbbbc460cec20",
      "old_mode": 33188,
      "old_path": "fs/autofs4/waitq.c",
      "new_id": "9c098db433441a36613dd126b8487ed54036f49e",
      "new_mode": 33188,
      "new_path": "fs/autofs4/waitq.c"
    }
  ]
}
