Repository navigation
Commit 15a2015
committed
ceph: fix iput race when queueing inode work
If we queue a work item that calls iput(), make sure we ihold() before
attempting to queue work. Otherwise our queued work might miraculously run
before we notice the queue_work() succeeded and call ihold(), allowing the
inode to be destroyed.
That is, instead of
if (queue_work(...))
ihold();
we need to do
ihold();
if (!queue_work(...))
iput();
Reported-by: Amon Ott <a.ott@m-privacy.de>
Signed-off-by: Sage Weil <sage@newdream.net>1 parent 0c6d4b4 commit 15a2015
1 file changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1328 | 1328 | | |
1329 | 1329 | | |
1330 | 1330 | | |
| 1331 | + | |
1331 | 1332 | | |
1332 | 1333 | | |
1333 | 1334 | | |
1334 | | - | |
1335 | 1335 | | |
1336 | 1336 | | |
| 1337 | + | |
1337 | 1338 | | |
1338 | 1339 | | |
1339 | 1340 | | |
| |||
1353 | 1354 | | |
1354 | 1355 | | |
1355 | 1356 | | |
| 1357 | + | |
1356 | 1358 | | |
1357 | 1359 | | |
1358 | 1360 | | |
1359 | | - | |
1360 | 1361 | | |
1361 | 1362 | | |
| 1363 | + | |
1362 | 1364 | | |
1363 | 1365 | | |
1364 | 1366 | | |
| |||
1434 | 1436 | | |
1435 | 1437 | | |
1436 | 1438 | | |
| 1439 | + | |
1437 | 1440 | | |
1438 | 1441 | | |
1439 | 1442 | | |
1440 | | - | |
1441 | 1443 | | |
1442 | 1444 | | |
1443 | 1445 | | |
| 1446 | + | |
1444 | 1447 | | |
1445 | 1448 | | |
1446 | 1449 | | |
| |||
0 commit comments