Commit 6b69e48
Darrick J. Wong
xfs: standardize extent size hint validation
While chasing a bug involving invalid extent size hints being propagated
into newly created realtime files, I noticed that the xfs_ioctl_setattr
checks for the extent size hints weren't the same as the ones now
encoded in libxfs and used for validation in repair and mkfs.
Because the checks in libxfs are more stringent than the ones in the
ioctl, it's possible for a live system to set inode flags that
immediately result in corruption warnings. Specifically, it's possible
to set an extent size hint on an rtinherit directory without checking if
the hint is aligned to the realtime extent size, which makes no sense
since that combination is used only to seed new realtime files.
Replace the open-coded and inadequate checks with the libxfs verifier
versions and update the code comments a bit.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>1 parent 0f93425 commit 6b69e48
2 files changed
Lines changed: 41 additions & 73 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
562 | | - | |
563 | | - | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
564 | 573 | | |
565 | 574 | | |
566 | 575 | | |
| |||
616 | 625 | | |
617 | 626 | | |
618 | 627 | | |
619 | | - | |
620 | | - | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
621 | 637 | | |
622 | 638 | | |
623 | 639 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1267 | 1267 | | |
1268 | 1268 | | |
1269 | 1269 | | |
1270 | | - | |
1271 | | - | |
1272 | | - | |
1273 | | - | |
1274 | | - | |
1275 | | - | |
1276 | | - | |
1277 | | - | |
1278 | | - | |
1279 | | - | |
1280 | | - | |
1281 | | - | |
1282 | | - | |
1283 | | - | |
| 1270 | + | |
| 1271 | + | |
1284 | 1272 | | |
1285 | 1273 | | |
1286 | 1274 | | |
1287 | 1275 | | |
1288 | 1276 | | |
1289 | 1277 | | |
1290 | 1278 | | |
1291 | | - | |
1292 | | - | |
| 1279 | + | |
| 1280 | + | |
1293 | 1281 | | |
1294 | 1282 | | |
1295 | 1283 | | |
1296 | 1284 | | |
1297 | 1285 | | |
1298 | | - | |
| 1286 | + | |
1299 | 1287 | | |
1300 | 1288 | | |
1301 | | - | |
1302 | | - | |
1303 | | - | |
1304 | | - | |
1305 | | - | |
| 1289 | + | |
1306 | 1290 | | |
1307 | 1291 | | |
1308 | | - | |
1309 | | - | |
1310 | | - | |
1311 | | - | |
1312 | | - | |
1313 | | - | |
1314 | | - | |
1315 | | - | |
1316 | | - | |
1317 | | - | |
1318 | | - | |
| 1292 | + | |
1319 | 1293 | | |
1320 | | - | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
1321 | 1298 | | |
1322 | 1299 | | |
1323 | | - | |
1324 | | - | |
1325 | | - | |
1326 | | - | |
1327 | | - | |
1328 | | - | |
1329 | | - | |
1330 | | - | |
1331 | | - | |
1332 | | - | |
1333 | | - | |
1334 | | - | |
1335 | | - | |
1336 | | - | |
1337 | | - | |
1338 | 1300 | | |
1339 | 1301 | | |
1340 | 1302 | | |
1341 | 1303 | | |
1342 | 1304 | | |
1343 | 1305 | | |
1344 | | - | |
1345 | | - | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
1346 | 1309 | | |
1347 | 1310 | | |
1348 | 1311 | | |
1349 | 1312 | | |
1350 | | - | |
1351 | | - | |
1352 | | - | |
1353 | | - | |
1354 | | - | |
1355 | | - | |
1356 | | - | |
1357 | | - | |
1358 | | - | |
1359 | | - | |
1360 | | - | |
1361 | | - | |
1362 | | - | |
1363 | | - | |
1364 | | - | |
| 1313 | + | |
1365 | 1314 | | |
1366 | 1315 | | |
1367 | | - | |
1368 | | - | |
| 1316 | + | |
| 1317 | + | |
1369 | 1318 | | |
1370 | | - | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
1371 | 1323 | | |
1372 | 1324 | | |
1373 | 1325 | | |
| |||
0 commit comments