diff options
Diffstat (limited to 'meta/recipes-extended/parted/files/0001-libparted-Use-read-only-when-probing-devices-on-linu.patch')
-rw-r--r-- | meta/recipes-extended/parted/files/0001-libparted-Use-read-only-when-probing-devices-on-linu.patch | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/meta/recipes-extended/parted/files/0001-libparted-Use-read-only-when-probing-devices-on-linu.patch b/meta/recipes-extended/parted/files/0001-libparted-Use-read-only-when-probing-devices-on-linu.patch index e522e1c6ef..39107620d5 100644 --- a/meta/recipes-extended/parted/files/0001-libparted-Use-read-only-when-probing-devices-on-linu.patch +++ b/meta/recipes-extended/parted/files/0001-libparted-Use-read-only-when-probing-devices-on-linu.patch | |||
@@ -1,7 +1,8 @@ | |||
1 | From d6e15a60e84c1511523aa81272b7db7a6ec441d0 Mon Sep 17 00:00:00 2001 | 1 | From 843225aa9d5077bebdb08bbf9699c02aec0b83eb Mon Sep 17 00:00:00 2001 |
2 | From: Ovidiu Panait <ovidiu.panait@windriver.com> | 2 | From: "Brian C. Lane" <bcl@redhat.com> |
3 | Date: Tue, 26 Sep 2017 08:04:58 +0000 | 3 | Date: Tue, 26 Sep 2017 08:04:58 +0000 |
4 | Subject: [PATCH] libparted: Use read only when probing devices on linux | 4 | Subject: [PATCH] libparted: Use read only when probing devices on linux |
5 | |||
5 | (#1245144) | 6 | (#1245144) |
6 | 7 | ||
7 | When a device is opened for RW closing it can trigger other actions, | 8 | When a device is opened for RW closing it can trigger other actions, |
@@ -25,17 +26,17 @@ Resolves: rhbz#1245144 | |||
25 | 26 | ||
26 | Upstream-Status: Backport | 27 | Upstream-Status: Backport |
27 | 28 | ||
28 | Author: Brian C. Lane <bcl@redhat.com> | ||
29 | Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> | 29 | Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> |
30 | |||
30 | --- | 31 | --- |
31 | libparted/arch/linux.c | 62 +++++++++++++++++++++++++++++++++++--------------- | 32 | libparted/arch/linux.c | 62 +++++++++++++++++++++++++++++++++++--------------- |
32 | 1 file changed, 44 insertions(+), 18 deletions(-) | 33 | 1 file changed, 44 insertions(+), 18 deletions(-) |
33 | 34 | ||
34 | diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c | 35 | diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c |
35 | index f612617..0a06a54 100644 | 36 | index 7f12f58..4ddea58 100644 |
36 | --- a/libparted/arch/linux.c | 37 | --- a/libparted/arch/linux.c |
37 | +++ b/libparted/arch/linux.c | 38 | +++ b/libparted/arch/linux.c |
38 | @@ -294,7 +294,9 @@ struct blkdev_ioctl_param { | 39 | @@ -292,7 +292,9 @@ struct blkdev_ioctl_param { |
39 | static char* _device_get_part_path (PedDevice const *dev, int num); | 40 | static char* _device_get_part_path (PedDevice const *dev, int num); |
40 | static int _partition_is_mounted_by_path (const char* path); | 41 | static int _partition_is_mounted_by_path (const char* path); |
41 | static unsigned int _device_get_partition_range(PedDevice const* dev); | 42 | static unsigned int _device_get_partition_range(PedDevice const* dev); |
@@ -46,7 +47,7 @@ index f612617..0a06a54 100644 | |||
46 | 47 | ||
47 | static int | 48 | static int |
48 | _read_fd (int fd, char **buf) | 49 | _read_fd (int fd, char **buf) |
49 | @@ -913,7 +915,7 @@ init_ide (PedDevice* dev) | 50 | @@ -911,7 +913,7 @@ init_ide (PedDevice* dev) |
50 | if (!_device_stat (dev, &dev_stat)) | 51 | if (!_device_stat (dev, &dev_stat)) |
51 | goto error; | 52 | goto error; |
52 | 53 | ||
@@ -55,7 +56,7 @@ index f612617..0a06a54 100644 | |||
55 | goto error; | 56 | goto error; |
56 | 57 | ||
57 | if (ioctl (arch_specific->fd, HDIO_GET_IDENTITY, &hdi)) { | 58 | if (ioctl (arch_specific->fd, HDIO_GET_IDENTITY, &hdi)) { |
58 | @@ -982,11 +984,11 @@ init_ide (PedDevice* dev) | 59 | @@ -980,11 +982,11 @@ init_ide (PedDevice* dev) |
59 | if (!_device_probe_geometry (dev)) | 60 | if (!_device_probe_geometry (dev)) |
60 | goto error_close_dev; | 61 | goto error_close_dev; |
61 | 62 | ||
@@ -69,7 +70,7 @@ index f612617..0a06a54 100644 | |||
69 | error: | 70 | error: |
70 | return 0; | 71 | return 0; |
71 | } | 72 | } |
72 | @@ -1119,7 +1121,7 @@ init_scsi (PedDevice* dev) | 73 | @@ -1117,7 +1119,7 @@ init_scsi (PedDevice* dev) |
73 | char* vendor; | 74 | char* vendor; |
74 | char* product; | 75 | char* product; |
75 | 76 | ||
@@ -78,7 +79,7 @@ index f612617..0a06a54 100644 | |||
78 | goto error; | 79 | goto error; |
79 | 80 | ||
80 | if (ioctl (arch_specific->fd, SCSI_IOCTL_GET_IDLUN, &idlun) < 0) { | 81 | if (ioctl (arch_specific->fd, SCSI_IOCTL_GET_IDLUN, &idlun) < 0) { |
81 | @@ -1133,7 +1135,7 @@ init_scsi (PedDevice* dev) | 82 | @@ -1131,7 +1133,7 @@ init_scsi (PedDevice* dev) |
82 | goto error_close_dev; | 83 | goto error_close_dev; |
83 | if (!_device_probe_geometry (dev)) | 84 | if (!_device_probe_geometry (dev)) |
84 | goto error_close_dev; | 85 | goto error_close_dev; |
@@ -87,7 +88,7 @@ index f612617..0a06a54 100644 | |||
87 | return 1; | 88 | return 1; |
88 | } | 89 | } |
89 | 90 | ||
90 | @@ -1155,11 +1157,11 @@ init_scsi (PedDevice* dev) | 91 | @@ -1153,11 +1155,11 @@ init_scsi (PedDevice* dev) |
91 | if (!_device_probe_geometry (dev)) | 92 | if (!_device_probe_geometry (dev)) |
92 | goto error_close_dev; | 93 | goto error_close_dev; |
93 | 94 | ||
@@ -101,7 +102,7 @@ index f612617..0a06a54 100644 | |||
101 | error: | 102 | error: |
102 | return 0; | 103 | return 0; |
103 | } | 104 | } |
104 | @@ -1171,7 +1173,7 @@ init_file (PedDevice* dev) | 105 | @@ -1169,7 +1171,7 @@ init_file (PedDevice* dev) |
105 | 106 | ||
106 | if (!_device_stat (dev, &dev_stat)) | 107 | if (!_device_stat (dev, &dev_stat)) |
107 | goto error; | 108 | goto error; |
@@ -110,7 +111,7 @@ index f612617..0a06a54 100644 | |||
110 | goto error; | 111 | goto error; |
111 | 112 | ||
112 | dev->sector_size = PED_SECTOR_SIZE_DEFAULT; | 113 | dev->sector_size = PED_SECTOR_SIZE_DEFAULT; |
113 | @@ -1198,7 +1200,7 @@ init_file (PedDevice* dev) | 114 | @@ -1196,7 +1198,7 @@ init_file (PedDevice* dev) |
114 | goto error_close_dev; | 115 | goto error_close_dev; |
115 | } | 116 | } |
116 | 117 | ||
@@ -119,7 +120,7 @@ index f612617..0a06a54 100644 | |||
119 | 120 | ||
120 | dev->bios_geom.cylinders = dev->length / 4 / 32; | 121 | dev->bios_geom.cylinders = dev->length / 4 / 32; |
121 | dev->bios_geom.heads = 4; | 122 | dev->bios_geom.heads = 4; |
122 | @@ -1209,7 +1211,7 @@ init_file (PedDevice* dev) | 123 | @@ -1207,7 +1209,7 @@ init_file (PedDevice* dev) |
123 | return 1; | 124 | return 1; |
124 | 125 | ||
125 | error_close_dev: | 126 | error_close_dev: |
@@ -128,7 +129,7 @@ index f612617..0a06a54 100644 | |||
128 | error: | 129 | error: |
129 | return 0; | 130 | return 0; |
130 | } | 131 | } |
131 | @@ -1225,7 +1227,7 @@ init_dasd (PedDevice* dev, const char* model_name) | 132 | @@ -1223,7 +1225,7 @@ init_dasd (PedDevice* dev, const char* model_name) |
132 | if (!_device_stat (dev, &dev_stat)) | 133 | if (!_device_stat (dev, &dev_stat)) |
133 | goto error; | 134 | goto error; |
134 | 135 | ||
@@ -137,7 +138,7 @@ index f612617..0a06a54 100644 | |||
137 | goto error; | 138 | goto error; |
138 | 139 | ||
139 | LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev); | 140 | LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev); |
140 | @@ -1265,11 +1267,11 @@ init_dasd (PedDevice* dev, const char* model_name) | 141 | @@ -1263,11 +1265,11 @@ init_dasd (PedDevice* dev, const char* model_name) |
141 | 142 | ||
142 | dev->model = strdup (model_name); | 143 | dev->model = strdup (model_name); |
143 | 144 | ||
@@ -151,7 +152,7 @@ index f612617..0a06a54 100644 | |||
151 | error: | 152 | error: |
152 | return 0; | 153 | return 0; |
153 | } | 154 | } |
154 | @@ -1284,7 +1286,7 @@ init_generic (PedDevice* dev, const char* model_name) | 155 | @@ -1282,7 +1284,7 @@ init_generic (PedDevice* dev, const char* model_name) |
155 | if (!_device_stat (dev, &dev_stat)) | 156 | if (!_device_stat (dev, &dev_stat)) |
156 | goto error; | 157 | goto error; |
157 | 158 | ||
@@ -160,7 +161,7 @@ index f612617..0a06a54 100644 | |||
160 | goto error; | 161 | goto error; |
161 | 162 | ||
162 | ped_exception_fetch_all (); | 163 | ped_exception_fetch_all (); |
163 | @@ -1332,11 +1334,11 @@ init_generic (PedDevice* dev, const char* model_name) | 164 | @@ -1330,11 +1332,11 @@ init_generic (PedDevice* dev, const char* model_name) |
164 | 165 | ||
165 | dev->model = strdup (model_name); | 166 | dev->model = strdup (model_name); |
166 | 167 | ||
@@ -174,7 +175,7 @@ index f612617..0a06a54 100644 | |||
174 | error: | 175 | error: |
175 | return 0; | 176 | return 0; |
176 | } | 177 | } |
177 | @@ -1623,12 +1625,27 @@ retry: | 178 | @@ -1621,12 +1623,27 @@ retry: |
178 | } | 179 | } |
179 | 180 | ||
180 | static int | 181 | static int |
@@ -203,7 +204,7 @@ index f612617..0a06a54 100644 | |||
203 | 204 | ||
204 | if (arch_specific->fd == -1) { | 205 | if (arch_specific->fd == -1) { |
205 | char* rw_error_msg = strerror (errno); | 206 | char* rw_error_msg = strerror (errno); |
206 | @@ -1697,6 +1714,15 @@ linux_refresh_close (PedDevice* dev) | 207 | @@ -1695,6 +1712,15 @@ linux_refresh_close (PedDevice* dev) |
207 | return 1; | 208 | return 1; |
208 | } | 209 | } |
209 | 210 | ||
@@ -218,7 +219,4 @@ index f612617..0a06a54 100644 | |||
218 | + | 219 | + |
219 | #if SIZEOF_OFF_T < 8 | 220 | #if SIZEOF_OFF_T < 8 |
220 | 221 | ||
221 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) | 222 | static _syscall5(int,_llseek, |
222 | -- | ||
223 | 2.11.0 | ||
224 | |||