diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index cced062cab4b..cb5c9d8ea139 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c @@ -1802,6 +1802,11 @@ int bitmap_resize(struct bitmap *bitmap, sector_t blocks, long pages; struct bitmap_page *new_bp; + if (bitmap->storage.file && !init) { + pr_info("md: cannot resize file-based bitmap\n"); + return -EINVAL; + } + if (chunksize == 0) { /* If there is enough space, leave the chunk size unchanged, * else increase by factor of two until there is enough space.