diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-28 12:58:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-28 12:58:38 -0400 |
commit | e9c0f1529c9022afbab16a442382aa9a84a79c41 (patch) | |
tree | 173e99d46283f5d814bf4407728ad0d2ea702100 | |
parent | b18dafc86bb879d2f38a1743985d7ceb283c2f4d (diff) | |
parent | 5bdad93387c64f0095df7ae9a252ff44234a8b3f (diff) |
Merge tag 'for-linus-3.4-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs
Pull 9p changes for the 3.4 merge window from Eric Van Hensbergen.
* tag 'for-linus-3.4-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh/v9fs:
9p: statfs should not override server f_type
net/9p: handle flushed Tclunk/Tremove
net/9p: don't allow Tflush to be interrupted
-rw-r--r-- | fs/9p/vfs_super.c | 2 | ||||
-rw-r--r-- | net/9p/client.c | 26 |
2 files changed, 24 insertions, 4 deletions
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c index 10b7d3c9dba8..8c92a9ba8330 100644 --- a/fs/9p/vfs_super.c +++ b/fs/9p/vfs_super.c | |||
@@ -259,7 +259,7 @@ static int v9fs_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
259 | if (v9fs_proto_dotl(v9ses)) { | 259 | if (v9fs_proto_dotl(v9ses)) { |
260 | res = p9_client_statfs(fid, &rs); | 260 | res = p9_client_statfs(fid, &rs); |
261 | if (res == 0) { | 261 | if (res == 0) { |
262 | buf->f_type = V9FS_MAGIC; | 262 | buf->f_type = rs.type; |
263 | buf->f_bsize = rs.bsize; | 263 | buf->f_bsize = rs.bsize; |
264 | buf->f_blocks = rs.blocks; | 264 | buf->f_blocks = rs.blocks; |
265 | buf->f_bfree = rs.bfree; | 265 | buf->f_bfree = rs.bfree; |
diff --git a/net/9p/client.c b/net/9p/client.c index 776618cd2be5..b23a17c431c8 100644 --- a/net/9p/client.c +++ b/net/9p/client.c | |||
@@ -740,10 +740,18 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...) | |||
740 | c->status = Disconnected; | 740 | c->status = Disconnected; |
741 | goto reterr; | 741 | goto reterr; |
742 | } | 742 | } |
743 | again: | ||
743 | /* Wait for the response */ | 744 | /* Wait for the response */ |
744 | err = wait_event_interruptible(*req->wq, | 745 | err = wait_event_interruptible(*req->wq, |
745 | req->status >= REQ_STATUS_RCVD); | 746 | req->status >= REQ_STATUS_RCVD); |
746 | 747 | ||
748 | if ((err == -ERESTARTSYS) && (c->status == Connected) | ||
749 | && (type == P9_TFLUSH)) { | ||
750 | sigpending = 1; | ||
751 | clear_thread_flag(TIF_SIGPENDING); | ||
752 | goto again; | ||
753 | } | ||
754 | |||
747 | if (req->status == REQ_STATUS_ERROR) { | 755 | if (req->status == REQ_STATUS_ERROR) { |
748 | p9_debug(P9_DEBUG_ERROR, "req_status error %d\n", req->t_err); | 756 | p9_debug(P9_DEBUG_ERROR, "req_status error %d\n", req->t_err); |
749 | err = req->t_err; | 757 | err = req->t_err; |
@@ -1420,6 +1428,7 @@ int p9_client_clunk(struct p9_fid *fid) | |||
1420 | int err; | 1428 | int err; |
1421 | struct p9_client *clnt; | 1429 | struct p9_client *clnt; |
1422 | struct p9_req_t *req; | 1430 | struct p9_req_t *req; |
1431 | int retries = 0; | ||
1423 | 1432 | ||
1424 | if (!fid) { | 1433 | if (!fid) { |
1425 | pr_warn("%s (%d): Trying to clunk with NULL fid\n", | 1434 | pr_warn("%s (%d): Trying to clunk with NULL fid\n", |
@@ -1428,7 +1437,9 @@ int p9_client_clunk(struct p9_fid *fid) | |||
1428 | return 0; | 1437 | return 0; |
1429 | } | 1438 | } |
1430 | 1439 | ||
1431 | 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); | ||
1432 | err = 0; | 1443 | err = 0; |
1433 | clnt = fid->clnt; | 1444 | clnt = fid->clnt; |
1434 | 1445 | ||
@@ -1444,8 +1455,14 @@ int p9_client_clunk(struct p9_fid *fid) | |||
1444 | error: | 1455 | error: |
1445 | /* | 1456 | /* |
1446 | * 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. | ||
1447 | */ | 1460 | */ |
1448 | p9_fid_destroy(fid); | 1461 | if (err == -ERESTARTSYS) { |
1462 | if (retries++ == 0) | ||
1463 | goto again; | ||
1464 | } else | ||
1465 | p9_fid_destroy(fid); | ||
1449 | return err; | 1466 | return err; |
1450 | } | 1467 | } |
1451 | EXPORT_SYMBOL(p9_client_clunk); | 1468 | EXPORT_SYMBOL(p9_client_clunk); |
@@ -1470,7 +1487,10 @@ int p9_client_remove(struct p9_fid *fid) | |||
1470 | 1487 | ||
1471 | p9_free_req(clnt, req); | 1488 | p9_free_req(clnt, req); |
1472 | error: | 1489 | error: |
1473 | p9_fid_destroy(fid); | 1490 | if (err == -ERESTARTSYS) |
1491 | p9_client_clunk(fid); | ||
1492 | else | ||
1493 | p9_fid_destroy(fid); | ||
1474 | return err; | 1494 | return err; |
1475 | } | 1495 | } |
1476 | EXPORT_SYMBOL(p9_client_remove); | 1496 | EXPORT_SYMBOL(p9_client_remove); |