diff options
-rw-r--r-- | net/9p/client.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/net/9p/client.c b/net/9p/client.c index 6efbb334c3a..b23a17c431c 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -1428,6 +1428,7 @@ int p9_client_clunk(struct p9_fid *fid) | |||
1428 | int err; | 1428 | int err; |
1429 | struct p9_client *clnt; | 1429 | struct p9_client *clnt; |
1430 | struct p9_req_t *req; | 1430 | struct p9_req_t *req; |
1431 | int retries = 0; | ||
1431 | 1432 | ||
1432 | if (!fid) { | 1433 | if (!fid) { |
1433 | pr_warn("%s (%d): Trying to clunk with NULL fid\n", | 1434 | pr_warn("%s (%d): Trying to clunk with NULL fid\n", |
@@ -1436,7 +1437,9 @@ int p9_client_clunk(struct p9_fid *fid) | |||
1436 | return 0; | 1437 | return 0; |
1437 | } | 1438 | } |
1438 | 1439 | ||
1439 | p9_debug(P9_DEBUG_9P, ">>> TCLUNK fid %d\n", fid->fid); | 1440 | again: |
1441 | p9_debug(P9_DEBUG_9P, ">>> TCLUNK fid %d (try %d)\n", fid->fid, | ||
1442 | retries); | ||
1440 | err = 0; | 1443 | err = 0; |
1441 | clnt = fid->clnt; | 1444 | clnt = fid->clnt; |
1442 | 1445 | ||
@@ -1452,8 +1455,14 @@ int p9_client_clunk(struct p9_fid *fid) | |||
1452 | error: | 1455 | error: |
1453 | /* | 1456 | /* |
1454 | * Fid is not valid even after a failed clunk | 1457 | * Fid is not valid even after a failed clunk |
1458 | * If interrupted, retry once then give up and | ||
1459 | * leak fid until umount. | ||
1455 | */ | 1460 | */ |
1456 | p9_fid_destroy(fid); | 1461 | if (err == -ERESTARTSYS) { |
1462 | if (retries++ == 0) | ||
1463 | goto again; | ||
1464 | } else | ||
1465 | p9_fid_destroy(fid); | ||
1457 | return err; | 1466 | return err; |
1458 | } | 1467 | } |
1459 | EXPORT_SYMBOL(p9_client_clunk); | 1468 | EXPORT_SYMBOL(p9_client_clunk); |
@@ -1478,7 +1487,10 @@ int p9_client_remove(struct p9_fid *fid) | |||
1478 | 1487 | ||
1479 | p9_free_req(clnt, req); | 1488 | p9_free_req(clnt, req); |
1480 | error: | 1489 | error: |
1481 | p9_fid_destroy(fid); | 1490 | if (err == -ERESTARTSYS) |
1491 | p9_client_clunk(fid); | ||
1492 | else | ||
1493 | p9_fid_destroy(fid); | ||
1482 | return err; | 1494 | return err; |
1483 | } | 1495 | } |
1484 | EXPORT_SYMBOL(p9_client_remove); | 1496 | EXPORT_SYMBOL(p9_client_remove); |