)]}'
{
  "commit": "393418676a7602e1d7d3f6e560159c65c8cbd50e",
  "tree": "26b166e426748a7a4bfe3784cd8258a895daba79",
  "parents": [
    "3300beda523136f9f87821e4fba85c5c9e319645"
  ],
  "author": {
    "name": "Aneesh Kumar K.V",
    "email": "aneesh.kumar@linux.vnet.ibm.com",
    "time": "Mon Jan 05 21:38:14 2009 -0500"
  },
  "committer": {
    "name": "Theodore Ts\u0027o",
    "email": "tytso@mit.edu",
    "time": "Mon Jan 05 21:38:14 2009 -0500"
  },
  "message": "ext4: Fix the race between read_inode_bitmap() and ext4_new_inode()\n\nWe need to make sure we update the inode bitmap and clear\nEXT4_BG_INODE_UNINIT flag with sb_bgl_lock held, since\next4_read_inode_bitmap() looks at EXT4_BG_INODE_UNINIT to decide\nwhether to initialize the inode bitmap each time it is called.\n(introduced by commit c806e68f.)\n\next4_read_inode_bitmap does:\n\nspin_lock(sb_bgl_lock(EXT4_SB(sb), block_group));\nif (desc-\u003ebg_flags \u0026 cpu_to_le16(EXT4_BG_INODE_UNINIT)) {\n\text4_init_inode_bitmap(sb, bh, block_group, desc);\n\nand ext4_new_inode does\nif (!ext4_set_bit_atomic(sb_bgl_lock(sbi, group),\n                   ino, inode_bitmap_bh-\u003eb_data))\n\t\t   ......\n\t\t   ...\nspin_lock(sb_bgl_lock(sbi, group));\n\ngdp-\u003ebg_flags \u0026\u003d cpu_to_le16(~EXT4_BG_INODE_UNINIT);\ni.e., on allocation we update the bitmap then we take the sb_bgl_lock\nand clear the EXT4_BG_INODE_UNINIT flag. What can happen is a\nparallel ext4_read_inode_bitmap can zero out the bitmap in between\nthe above ext4_set_bit_atomic and spin_lock(sb_bg_lock..)\n\nThe race results in below user visible errors\nEXT4-fs error (device sdb1): ext4_free_inode: bit already cleared for inode 168449\nEXT4-fs warning (device sdb1): ext4_unlink: Deleting nonexistent file ...\nEXT4-fs warning (device sdb1): ext4_rmdir: empty directory has too many links ...\n# ls -al /mnt/tmp/f/p369/d3/d6/d39/db2/dee/d10f/d3f/l71\nls: /mnt/tmp/f/p369/d3/d6/d39/db2/dee/d10f/d3f/l71: Stale NFS file handle\n\nSigned-off-by: Aneesh Kumar K.V \u003caneesh.kumar@linux.vnet.ibm.com\u003e\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\nCc: stable@kernel.org\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b47427a21f1c14f63564bd9d6e9f816a5c86c63b",
      "old_mode": 33188,
      "old_path": "fs/ext4/ialloc.c",
      "new_id": "d4e544f30be20e56d9b8975d911caaefabefb759",
      "new_mode": 33188,
      "new_path": "fs/ext4/ialloc.c"
    }
  ]
}
