On 13.01.20 г. 11:41 ч., Nikolay Borisov wrote:
> This is enough to exercise out of boundary address exclusion as well as
> address matching.
>
> Signed-off-by: Nikolay Borisov <nborisov@xxxxxxxx>
> ---
>
> V3:
> * Defined "failed to alloc device" as in test_error
> * Don't capitalize first letter in error messages
> * Added proper handling of add_extent_mapping error
>
> V2:
> * Adjusted comments about some members of struct rmap_test_vector
> * Fixed inline comments
> * Correctly handle error when initialising dummy device
> * Other minor cosmetic changes around comments/braces for single statement 'if'
> and structure initialization
>
> fs/btrfs/tests/btrfs-tests.c | 1 +
> fs/btrfs/tests/extent-map-tests.c | 149 +++++++++++++++++++++++++++++-
> 2 files changed, 149 insertions(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/tests/btrfs-tests.c b/fs/btrfs/tests/btrfs-tests.c
> index 1710f2533d04..c13ed41d4e9f 100644
> --- a/fs/btrfs/tests/btrfs-tests.c
> +++ b/fs/btrfs/tests/btrfs-tests.c
> @@ -27,6 +27,7 @@ const char *test_error[] = {
> [TEST_ALLOC_INODE] = "cannot allocate inode",
> [TEST_ALLOC_BLOCK_GROUP] = "cannot allocate block group",
> [TEST_ALLOC_EXTENT_MAP] = "cannot allocate extent map",
> + [TEST_ALLOC_DEVICE] = "cannot allocate device",
> };
>
Meh, this patch also needs the following hunk:
diff --git a/fs/btrfs/tests/btrfs-tests.h b/fs/btrfs/tests/btrfs-tests.h
index 7a2d7ffbe30e..f6f1c173a530 100644
--- a/fs/btrfs/tests/btrfs-tests.h
+++ b/fs/btrfs/tests/btrfs-tests.h
@@ -23,6 +23,7 @@ enum {
TEST_ALLOC_INODE,
TEST_ALLOC_BLOCK_GROUP,
TEST_ALLOC_EXTENT_MAP,
+ TEST_ALLOC_DEVICE,
};