Commit 97538ee
committed
block: advisory locks: use byte-range locks to match QEMU behavior
Switch from a whole-file lock (0, 0 /* EOF */) to a byte-range lock
covering (0, disk.len()). This avoids issues in large cloud deployments
where Linux and management software may translate OFD locks into
mandatory locks on certain network filesystems.
With this change, management software can safely snapshot disk images
while a VM is running. Other Cloud Hypervisor instances will still be
prevented from using those images concurrently, as CHV continues to
enforce advisory lock checks.
This also brings our behavior in line with QEMU.
Whole-file locks remain a valid use case and could be supported later.
This patch only provides the necessary groundwork; making it configurable
is out of scope for now.
Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com1 parent 1498fee commit 97538ee
2 files changed
+63
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
104 | 133 | | |
105 | | - | |
| 134 | + | |
106 | 135 | | |
107 | 136 | | |
108 | 137 | | |
109 | | - | |
110 | | - | |
| 138 | + | |
| 139 | + | |
111 | 140 | | |
112 | 141 | | |
113 | 142 | | |
| |||
122 | 151 | | |
123 | 152 | | |
124 | 153 | | |
125 | | - | |
126 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
127 | 161 | | |
128 | 162 | | |
129 | 163 | | |
| |||
146 | 180 | | |
147 | 181 | | |
148 | 182 | | |
149 | | - | |
150 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
151 | 186 | | |
152 | 187 | | |
153 | 188 | | |
154 | 189 | | |
155 | 190 | | |
156 | 191 | | |
157 | 192 | | |
158 | | - | |
159 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
160 | 199 | | |
161 | 200 | | |
162 | 201 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
789 | 789 | | |
790 | 790 | | |
791 | 791 | | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
792 | 797 | | |
793 | | - | |
794 | | - | |
| 798 | + | |
| 799 | + | |
795 | 800 | | |
796 | 801 | | |
797 | 802 | | |
| |||
815 | 820 | | |
816 | 821 | | |
817 | 822 | | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
818 | 829 | | |
819 | 830 | | |
820 | 831 | | |
821 | | - | |
| 832 | + | |
822 | 833 | | |
823 | 834 | | |
824 | 835 | | |
| |||
0 commit comments