)]}'
{
  "commit": "64f371bc3107e69efce563a3d0f0e6880de0d537",
  "tree": "7eac8ef3bf7a6cc8f9e147b9bf341b14fc6ae7f3",
  "parents": [
    "9883035ae7edef3ec62ad215611cb8e17d6a1a5d"
  ],
  "author": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Sun Apr 29 13:30:08 2012 -0700"
  },
  "committer": {
    "name": "Linus Torvalds",
    "email": "torvalds@linux-foundation.org",
    "time": "Sun Apr 29 13:30:08 2012 -0700"
  },
  "message": "autofs: make the autofsv5 packet file descriptor use a packetized pipe\n\nThe autofs packet size has had a very unfortunate size problem on x86:\nbecause the alignment of \u0027u64\u0027 differs in 32-bit and 64-bit modes, and\nbecause the packet data was not 8-byte aligned, the size of the autofsv5\npacket structure differed between 32-bit and 64-bit modes despite\nlooking otherwise identical (300 vs 304 bytes respectively).\n\nWe first fixed that up by making the 64-bit compat mode know about this\nproblem in commit a32744d4abae (\"autofs: work around unhappy compat\nproblem on x86-64\"), and that made a 32-bit \u0027systemd\u0027 work happily on a\n64-bit kernel because everything then worked the same way as on a 32-bit\nkernel.\n\nBut it turned out that \u0027automount\u0027 had actually known and worked around\nthis problem in user space, so fixing the kernel to do the proper 32-bit\ncompatibility handling actually *broke* 32-bit automount on a 64-bit\nkernel, because it knew that the packet sizes were wrong and expected\nthose incorrect sizes.\n\nAs a result, we ended up reverting that compatibility mode fix, and\nthus breaking systemd again, in commit fcbf94b9dedd.\n\nWith both automount and systemd doing a single read() system call, and\nverifying that they get *exactly* the size they expect but using\ndifferent sizes, it seemed that fixing one of them inevitably seemed to\nbreak the other.  At one point, a patch I seriously considered applying\nfrom Michael Tokarev did a \"strcmp()\" to see if it was automount that\nwas doing the operation.  Ugly, ugly.\n\nHowever, a prettier solution exists now thanks to the packetized pipe\nmode.  By marking the communication pipe as being packetized (by simply\nsetting the O_DIRECT flag), we can always just write the bigger packet\nsize, and if user-space does a smaller read, it will just get that\npartial end result and the extra alignment padding will simply be thrown\naway.\n\nThis makes both automount and systemd happy, since they now get the size\nthey asked for, and the kernel side of autofs simply no longer needs to\ncare - it could pad out the packet arbitrarily.\n\nOf course, if there is some *other* user of autofs (please, please,\nplease tell me it ain\u0027t so - and we haven\u0027t heard of any) that tries to\nread the packets with multiple writes, that other user will now be\nbroken - the whole point of the packetized mode is that one system call\ngets exactly one packet, and you cannot read a packet in pieces.\n\nTested-by: Michael Tokarev \u003cmjt@tls.msk.ru\u003e\nCc: Alan Cox \u003calan@lxorguk.ukuu.org.uk\u003e\nCc: David Miller \u003cdavem@davemloft.net\u003e\nCc: Ian Kent \u003craven@themaw.net\u003e\nCc: Thomas Meyer \u003cthomas@m3y3r.de\u003e\nCc: stable@kernel.org\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": "908e18455413fc2e49a4d845c8020007dce95252",
      "new_mode": 33188,
      "new_path": "fs/autofs4/autofs_i.h"
    },
    {
      "type": "modify",
      "old_id": "3dfd615afb6b5442c0685392fdafb0adbf902343",
      "old_mode": 33188,
      "old_path": "fs/autofs4/dev-ioctl.c",
      "new_id": "aa9103f8f01bf8d3bad8d0dcbcc8036895226e3f",
      "new_mode": 33188,
      "new_path": "fs/autofs4/dev-ioctl.c"
    },
    {
      "type": "modify",
      "old_id": "14c7bc02349e063fc7be503962958d6c54310df5",
      "old_mode": 33188,
      "old_path": "fs/autofs4/inode.c",
      "new_id": "6e488ebe7784458623139c91ebd42fbba0752074",
      "new_mode": 33188,
      "new_path": "fs/autofs4/inode.c"
    }
  ]
}
