Przeglądaj źródła

Btrfs: deal with errors from updating the tree log

During unlink we remove any references to the inode from
the tree log.  It can return -ENOENT and other errors,
and this changes the unlink code to deal with it.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Chris Mason 14 lat temu
rodzic
commit
6418c96107
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      fs/btrfs/inode.c

+ 2 - 1
fs/btrfs/inode.c

@@ -2676,7 +2676,8 @@ int btrfs_unlink_inode(struct btrfs_trans_handle *trans,
 
 
 	ret = btrfs_del_dir_entries_in_log(trans, root, name, name_len,
 	ret = btrfs_del_dir_entries_in_log(trans, root, name, name_len,
 					   dir, index);
 					   dir, index);
-	BUG_ON(ret);
+	if (ret == -ENOENT)
+		ret = 0;
 err:
 err:
 	btrfs_free_path(path);
 	btrfs_free_path(path);
 	if (ret)
 	if (ret)