The VSS driver allocates a VMbus receive buffer significantly larger than sizeof(hv_vss_msg), with no explanation. To help prevent future mistakes, add a #define and comment about why this is done. No functional change.
Showing the changes to include/uapi/linux/hyperv.h (1 of 2 files). Show all
Unified · Split
| @@ -90,6 +90,17 @@ struct hv_vss_check_dm_info { · 89 unmodified lines | ||
| 90 | 90 | __u32 flags; |
| 91 | 91 | } __attribute__((packed)); |
| 92 | 92 | |
| 93 | +/* | |
| 94 | + * struct hv_vss_msg encodes the fields that the Linux VSS | |
| 95 | + * driver accesses. However, FREEZE messages from Hyper-V contain | |
| 96 | + * additional LUN information that Linux doesn't use and are not | |
| 97 | + * represented in struct hv_vss_msg. A received FREEZE message may | |
| 98 | + * be as large as 6,260 bytes, so the driver must allocate at least | |
| 99 | + * that much space, not sizeof(struct hv_vss_msg). Other messages | |
| 100 | + * such as AUTO_RECOVER may be as large as 12,500 bytes. However, | |
| 101 | + * because the Linux VSS driver responds that it doesn't support | |
| 102 | + * auto-recovery, it should not receive such messages. | |
| 103 | + */ | |
| 93 | 104 | struct hv_vss_msg { |
| 94 | 105 | union { |
| 95 | 106 | struct hv_vss_hdr vss_hdr; |