mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
virtio-mem: convert most offline_and_remove_memory() errors to -EBUSY
Just like we do with alloc_contig_range(), let's convert all unknown errors to -EBUSY, but WARN so we can look into the issue. For example, offline_pages() could fail with -EINTR, which would be unexpected in our case. Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20230713145551.2824980-3-david@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
f504e15b94
commit
ddf4098514
@ -741,11 +741,15 @@ static int virtio_mem_offline_and_remove_memory(struct virtio_mem *vm,
|
||||
* immediately instead of waiting.
|
||||
*/
|
||||
virtio_mem_retry(vm);
|
||||
} else {
|
||||
dev_dbg(&vm->vdev->dev,
|
||||
"offlining and removing memory failed: %d\n", rc);
|
||||
return 0;
|
||||
}
|
||||
return rc;
|
||||
dev_dbg(&vm->vdev->dev, "offlining and removing memory failed: %d\n", rc);
|
||||
/*
|
||||
* We don't really expect this to fail, because we fake-offlined all
|
||||
* memory already. But it could fail in corner cases.
|
||||
*/
|
||||
WARN_ON_ONCE(rc != -ENOMEM && rc != -EBUSY);
|
||||
return rc == -ENOMEM ? -ENOMEM : -EBUSY;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user