)]}'
{
  "commit": "da192f97aff39d9e5f71e34abc6968bfe39abee3",
  "tree": "c0febee5350d7254189dbdbaf43e010961303e7a",
  "parents": [
    "3408b875bc4447da7c5265bc599ecaa1a5f8d5af"
  ],
  "author": {
    "name": "David Howells",
    "email": "dhowells@redhat.com",
    "time": "Fri May 15 09:04:19 2026 +0100"
  },
  "committer": {
    "name": "David Howells",
    "email": "dhowells@redhat.com",
    "time": "Tue May 19 23:34:35 2026 +0100"
  },
  "message": "afs: [DON\u0027T MERGE] Do content encryption with an in-file trailer\n\nTo do content encryption, the data at the end of the file needs padding out\nto crypto block size (e.g. 16 or 32 bytes for AES types), but that means we\nneed somewhere to store the actual file length with the padding removed.\nTypically, this is stored in an xattr, though it could also be stored in\nthe file as an additional block at the front or end of the file.\n\nWith AFS, there are no xattrs and nowhere to store additional metadata, so\nthis information must be stored in the file.  Now, padding out the last\nblock to the fscrypt block size (4KiB, say) and then sticking a trailer\nafter it with the real size recorded therein is a problem for stat().  We\nhave to be able to read the file to be able to return the correct value in\nst_size; further, if the trailer is at the end of the file rather than the\nbeginning, we can\u0027t guess where real size is recorded and speculatively use\nthe FetchData RPC rather than the FetchStatus RPC as we need to know\ni_size.  Yet further, this doesn\u0027t work for bulk status fetch.\n\nHowever, lacking a vectored StoreData RPC, we really want to store extra\nmetadata at the end of the file as StoreData \"atomically\" combines a\ntruncate and a data write which would allow us to update the metadata too.\n\nWith this in mind, implement another alternative:\n\n (1) Store zero-length files as zero-length on the server.  These are\n     hereafter ignored in this description.\n\n (2) Place zeroed padding of one crypto block size (typically 16 or 32\n     bytes) after the real EOF and always constant size for any particular\n     file.  No information is stored here, though it may get partially\n     encrypted.\n\n (3) Simply subtract the crypto block size from the server\u0027s file size to\n     derive i_size.  This can be done when initialising/updating the inode\n     and will work with bulk status fetch.\n\n (4) When encrypting the EOF block in a file, if partial, encrypt into the\n     padding.\n\n (5) When decrypting the EOF block in a file, if partial, decrypt part of\n     the padding.\n\nSigned-off-by: David Howells \u003cdhowells@redhat.com\u003e\ncc: Marc Dionne \u003cmarc.dionne@auristor.com\u003e\ncc: linux-afs@lists.infradead.org\ncc: netfs@lists.linux.dev\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "d2e75f044a7a594bc960caa1702513edb6c043f4",
      "old_mode": 33188,
      "old_path": "fs/afs/file.c",
      "new_id": "d51e9c4358eb876dddfa1716cf14658692dcd4be",
      "new_mode": 33188,
      "new_path": "fs/afs/file.c"
    },
    {
      "type": "modify",
      "old_id": "c0dbbc6d3716e0b76f4e06870611b462d6091f04",
      "old_mode": 33188,
      "old_path": "fs/afs/fs_operation.c",
      "new_id": "9f1925b1ebfcd1eb100907f2192fc2f9a4308c4e",
      "new_mode": 33188,
      "new_path": "fs/afs/fs_operation.c"
    },
    {
      "type": "modify",
      "old_id": "1e7bfde6189a7a26412aeedeb1d1a7742647f853",
      "old_mode": 33188,
      "old_path": "fs/afs/inode.c",
      "new_id": "983b4f8eaeaece8f0add33fded963980790353a5",
      "new_mode": 33188,
      "new_path": "fs/afs/inode.c"
    },
    {
      "type": "modify",
      "old_id": "f201260005240315ad0975f8f64d0a7e854e0af8",
      "old_mode": 33188,
      "old_path": "fs/afs/internal.h",
      "new_id": "766c077bc56224d6c3a56943b76dee7bbd83c936",
      "new_mode": 33188,
      "new_path": "fs/afs/internal.h"
    },
    {
      "type": "modify",
      "old_id": "942f3e9800d7dc12a16189922b2b3b449e31cb1e",
      "old_mode": 33188,
      "old_path": "fs/afs/super.c",
      "new_id": "15568204a8c60b2facc4098e244caa938ccef955",
      "new_mode": 33188,
      "new_path": "fs/afs/super.c"
    },
    {
      "type": "modify",
      "old_id": "6a50b3c8fe61a9126fc888f6e0f12d13c1247fa3",
      "old_mode": 33188,
      "old_path": "fs/afs/write.c",
      "new_id": "6e33455d6cad821557292a1c557efbb7f4e2fc71",
      "new_mode": 33188,
      "new_path": "fs/afs/write.c"
    },
    {
      "type": "modify",
      "old_id": "06765c2e3e5567d0fd61517b1a5e24fdceec8c00",
      "old_mode": 33188,
      "old_path": "fs/netfs/buffered_read.c",
      "new_id": "2ecf8be5a21040c1b219110615e1fcdcfffd158f",
      "new_mode": 33188,
      "new_path": "fs/netfs/buffered_read.c"
    },
    {
      "type": "modify",
      "old_id": "74110e7b1e93f16e3f01e48f8ba9bd64ff682d9e",
      "old_mode": 33188,
      "old_path": "fs/netfs/bvecq.c",
      "new_id": "860bf1649d42554b08d4be1f9c82604226b09a28",
      "new_mode": 33188,
      "new_path": "fs/netfs/bvecq.c"
    },
    {
      "type": "modify",
      "old_id": "3ff8ed6dc4dda225e91c82b60bcba399aa5f1935",
      "old_mode": 33188,
      "old_path": "fs/netfs/crypto.c",
      "new_id": "a34add235b6da5ee9707e7e8ec8bef64d78d53e7",
      "new_mode": 33188,
      "new_path": "fs/netfs/crypto.c"
    },
    {
      "type": "modify",
      "old_id": "4866304d9936ff11c1e3948b4caf5311c4ea3131",
      "old_mode": 33188,
      "old_path": "fs/netfs/direct_write.c",
      "new_id": "ce994c6e775d4bd506e904a85c38c1143a3eb8f3",
      "new_mode": 33188,
      "new_path": "fs/netfs/direct_write.c"
    },
    {
      "type": "modify",
      "old_id": "b3d8eda5109c60636143b71619cee01c32968408",
      "old_mode": 33188,
      "old_path": "fs/netfs/write_collect.c",
      "new_id": "1ebaf814ef73d85a3d810f0512d0d2419c8b633a",
      "new_mode": 33188,
      "new_path": "fs/netfs/write_collect.c"
    },
    {
      "type": "modify",
      "old_id": "4f268c16b7d379bfa532f6914d321909c32a4ea7",
      "old_mode": 33188,
      "old_path": "fs/netfs/write_issue.c",
      "new_id": "d2049dd742cf014b20b8fc89168562f0dd0a15df",
      "new_mode": 33188,
      "new_path": "fs/netfs/write_issue.c"
    },
    {
      "type": "modify",
      "old_id": "fb2f89b325aae536d6bdda200ee0b209ac788e1a",
      "old_mode": 33188,
      "old_path": "include/linux/netfs.h",
      "new_id": "af815592cfe3075894617a24c031b253c9846bee",
      "new_mode": 33188,
      "new_path": "include/linux/netfs.h"
    }
  ]
}
