]> git.proxmox.com Git - mirror_ubuntu-artful-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 4 Apr 2018 09:53:25 +0000 (11:53 +0200)
commit649b7694a90a968e92b062e9c10c28f78eaceba7
tree97009d56fcd71e86bfe73529bb2f39c754bcad42
parent69b1c184ccef0c4bee38310ce09a5144433b9e5c
Btrfs: fix unexpected -EEXIST when creating new inode

BugLink: http://bugs.launchpad.net/bugs/1756860
commit 900c9981680067573671ecc5cbfa7c5770be3a40 upstream.

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: f32e48e92596 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Juerg Haefliger <juergh@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
fs/btrfs/tree-log.c