]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix unexpected -EEXIST when creating new inode
authorLiu Bo <bo.li.liu@oracle.com>
Thu, 25 Jan 2018 18:02:56 +0000 (11:02 -0700)
committerDavid Sterba <dsterba@suse.com>
Fri, 2 Feb 2018 15:24:53 +0000 (16:24 +0100)
commit5d9d413a771f8e20ffe2d4a9f189d62626016478
tree21d888f9be39ded9273d584ed1b552d15eeaa81f
parent99825fa104fac0eac213f1d6d937160614d5e963
Btrfs: fix unexpected -EEXIST when creating new inode

The highest objectid, which is assigned to new inode, is decided at
the time of initializing fs roots.  However, in cases where log replay
gets processed, the btree which fs root owns might be changed, so we
have to search it again for the highest objectid, otherwise creating
new inode would end up with -EEXIST.

cc: <stable@vger.kernel.org> v4.4-rc6+
Fixes: b240af46353f ("Btrfs: Initialize btrfs_root->highest_objectid when loading tree root and subvolume roots")
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tree-log.c