Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320533
b: refs/heads/master
c: 5cf02d0
h: refs/heads/master
i:
  320531: 4483d01
v: v3
  • Loading branch information
Jeff Layton authored and Trond Myklebust committed Jul 30, 2012
1 parent 88e3611 commit c8939a9
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 506026c3ec270e18402f0c9d33fee37482c23861
refs/heads/master: 5cf02d09b50b1ee1c2d536c9cf64af5a7d433f56
7 changes: 5 additions & 2 deletions trunk/fs/nfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,11 @@ static int nfs_release_page(struct page *page, gfp_t gfp)

dfprintk(PAGECACHE, "NFS: release_page(%p)\n", page);

/* Only do I/O if gfp is a superset of GFP_KERNEL */
if (mapping && (gfp & GFP_KERNEL) == GFP_KERNEL) {
/* Only do I/O if gfp is a superset of GFP_KERNEL, and we're not
* doing this memory reclaim for a fs-related allocation.
*/
if (mapping && (gfp & GFP_KERNEL) == GFP_KERNEL &&
!(current->flags & PF_FSTRANS)) {
int how = FLUSH_SYNC;

/* Don't let kswapd deadlock waiting for OOM RPC calls */
Expand Down
2 changes: 2 additions & 0 deletions trunk/net/sunrpc/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,9 @@ void rpc_execute(struct rpc_task *task)

static void rpc_async_schedule(struct work_struct *work)
{
current->flags |= PF_FSTRANS;
__rpc_execute(container_of(work, struct rpc_task, u.tk_work));
current->flags &= ~PF_FSTRANS;
}

/**
Expand Down
3 changes: 2 additions & 1 deletion trunk/net/sunrpc/xprtrdma/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ xprt_rdma_connect_worker(struct work_struct *work)
int rc = 0;

if (!xprt->shutdown) {
current->flags |= PF_FSTRANS;
xprt_clear_connected(xprt);

dprintk("RPC: %s: %sconnect\n", __func__,
Expand All @@ -212,10 +213,10 @@ xprt_rdma_connect_worker(struct work_struct *work)

out:
xprt_wake_pending_tasks(xprt, rc);

out_clear:
dprintk("RPC: %s: exit\n", __func__);
xprt_clear_connecting(xprt);
current->flags &= ~PF_FSTRANS;
}

/*
Expand Down
10 changes: 10 additions & 0 deletions trunk/net/sunrpc/xprtsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1895,6 +1895,8 @@ static void xs_local_setup_socket(struct work_struct *work)
if (xprt->shutdown)
goto out;

current->flags |= PF_FSTRANS;

clear_bit(XPRT_CONNECTION_ABORT, &xprt->state);
status = __sock_create(xprt->xprt_net, AF_LOCAL,
SOCK_STREAM, 0, &sock, 1);
Expand Down Expand Up @@ -1928,6 +1930,7 @@ static void xs_local_setup_socket(struct work_struct *work)
out:
xprt_clear_connecting(xprt);
xprt_wake_pending_tasks(xprt, status);
current->flags &= ~PF_FSTRANS;
}

static void xs_udp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock)
Expand Down Expand Up @@ -1970,6 +1973,8 @@ static void xs_udp_setup_socket(struct work_struct *work)
if (xprt->shutdown)
goto out;

current->flags |= PF_FSTRANS;

/* Start by resetting any existing state */
xs_reset_transport(transport);
sock = xs_create_sock(xprt, transport,
Expand All @@ -1988,6 +1993,7 @@ static void xs_udp_setup_socket(struct work_struct *work)
out:
xprt_clear_connecting(xprt);
xprt_wake_pending_tasks(xprt, status);
current->flags &= ~PF_FSTRANS;
}

/*
Expand Down Expand Up @@ -2113,6 +2119,8 @@ static void xs_tcp_setup_socket(struct work_struct *work)
if (xprt->shutdown)
goto out;

current->flags |= PF_FSTRANS;

if (!sock) {
clear_bit(XPRT_CONNECTION_ABORT, &xprt->state);
sock = xs_create_sock(xprt, transport,
Expand Down Expand Up @@ -2162,6 +2170,7 @@ static void xs_tcp_setup_socket(struct work_struct *work)
case -EINPROGRESS:
case -EALREADY:
xprt_clear_connecting(xprt);
current->flags &= ~PF_FSTRANS;
return;
case -EINVAL:
/* Happens, for instance, if the user specified a link
Expand All @@ -2174,6 +2183,7 @@ static void xs_tcp_setup_socket(struct work_struct *work)
out:
xprt_clear_connecting(xprt);
xprt_wake_pending_tasks(xprt, status);
current->flags &= ~PF_FSTRANS;
}

/**
Expand Down

0 comments on commit c8939a9

Please sign in to comment.