From patchwork Thu Jun 28 12:37:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mel Gorman X-Patchwork-Id: 167865 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A56C1B6FF5 for ; Thu, 28 Jun 2012 22:37:59 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754061Ab2F1Mhl (ORCPT ); Thu, 28 Jun 2012 08:37:41 -0400 Received: from cantor2.suse.de ([195.135.220.15]:36032 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752046Ab2F1Mhj (ORCPT ); Thu, 28 Jun 2012 08:37:39 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 12C52A52CD; Thu, 28 Jun 2012 14:37:38 +0200 (CEST) Date: Thu, 28 Jun 2012 13:37:34 +0100 From: Mel Gorman To: Jeff Layton Cc: Andrew Morton , Linux-MM , Linux-Netdev , Linux-NFS , LKML , David Miller , Trond Myklebust , Neil Brown , Christoph Hellwig , Peter Zijlstra , Mike Christie , Eric B Munson Subject: Re: [PATCH 10/12] nfs: enable swap on NFS Message-ID: <20120628123734.GH8271@suse.de> References: <1340375468-22509-1-git-send-email-mgorman@suse.de> <1340375468-22509-11-git-send-email-mgorman@suse.de> <20120628082725.33b71097@corrin.poochiereds.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120628082725.33b71097@corrin.poochiereds.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Jun 28, 2012 at 08:27:25AM -0400, Jeff Layton wrote: > > > > @@ -2108,11 +2156,15 @@ static void xs_tcp_setup_socket(struct work_struct *work) > > container_of(work, struct sock_xprt, connect_worker.work); > > struct socket *sock = transport->sock; > > struct rpc_xprt *xprt = &transport->xprt; > > + unsigned long pflags = current->flags; > > int status = -EIO; > > > > if (xprt->shutdown) > > goto out; > > > > + if (xprt->swapper) > > + current->flags |= PF_MEMALLOC; > > + > > if (!sock) { > > clear_bit(XPRT_CONNECTION_ABORT, &xprt->state); > > sock = xs_create_sock(xprt, transport, > > @@ -2174,6 +2226,7 @@ out_eagain: > > out: > > xprt_clear_connecting(xprt); > > xprt_wake_pending_tasks(xprt, status); > > + tsk_restore_flags(current, pflags, PF_MEMALLOC); > > } > > > > /** > > Apologies if this is fixed in another patch and I didn't see it... > No apologies necessary. Even if it was fixed in another patch, it would still be wrong for bisection reasons and for being rude to reviewers. > There's a place in the above function that returns without going > through "out:". I think you also want to tsk_restore_flags() in that > spot too. > You're right. The case that it would trigger would be some corner case but very nicely spotted. --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index b84df34..3d58b92 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -2214,6 +2214,7 @@ static void xs_tcp_setup_socket(struct work_struct *work) case -EINPROGRESS: case -EALREADY: xprt_clear_connecting(xprt); + tsk_restore_flags(current, pflags, PF_MEMALLOC); return; case -EINVAL: /* Happens, for instance, if the user specified a link