瀏覽代碼

Btrfs: Add checks for last byte in disk to allocator grouping

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Chris Mason 17 年之前
父節點
當前提交
068fe39fa1
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      fs/btrfs/extent-tree.c

+ 6 - 1
fs/btrfs/extent-tree.c

@@ -1611,8 +1611,13 @@ check_pending:
 	}
 	}
 	ins->offset = num_bytes;
 	ins->offset = num_bytes;
 	btrfs_free_path(path);
 	btrfs_free_path(path);
-	if (last_ptr)
+	if (last_ptr) {
 		*last_ptr = ins->objectid + ins->offset;
 		*last_ptr = ins->objectid + ins->offset;
+		if (*last_ptr ==
+		    btrfs_super_total_bytes(&root->fs_info->super_copy)) {
+			*last_ptr = 0;
+		}
+	}
 	return 0;
 	return 0;
 
 
 new_group:
 new_group: