mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Myklebust, Trond" <Trond.Myklebust@netapp.com>
To: "ycnian@gmail.com" <ycnian@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] nfs: Don't return referenced delegations
Date: Thu, 13 Dec 2012 14:34:53 +0000	[thread overview]
Message-ID: <4FA345DA4F4AE44899BD2B03EEEC2FA91192A73F@SACEXCMBX04-PRD.hq.netapp.com> (raw)
In-Reply-To: <1355380636-10915-1-git-send-email-ycnian@gmail.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1723 bytes --]

On Thu, 2012-12-13 at 14:37 +0800, ycnian@gmail.com wrote:
> From: Yanchuan Nian <ycnian@gmail.com>
> 
> The client returns unreferenced delegations in state management. It scans all
> delegations and tests the NFS_DELEGATION_REFERENCED flag. if this flag is not
> set, NFS_DELEGATION_RETURN will be set and the delegation will be returned. 
> But unfortunately NFS_DELEGATION_REFERENCED is cleared after the testing, so 
> delegations which are still being used will be returned in the next state
> management.
> 
> Signed-off-by: Yanchuan Nian <ycnian@gmail.com>
> ---
>  fs/nfs/delegation.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
> index 81c5eec..485e8c0 100644
> --- a/fs/nfs/delegation.c
> +++ b/fs/nfs/delegation.c
> @@ -506,7 +506,7 @@ static void nfs_mark_return_unreferenced_delegations(struct nfs_server *server)
>  	struct nfs_delegation *delegation;
>  
>  	list_for_each_entry_rcu(delegation, &server->delegations, super_list) {
> -		if (test_and_clear_bit(NFS_DELEGATION_REFERENCED, &delegation->flags))
> +		if (test_bit(NFS_DELEGATION_REFERENCED, &delegation->flags))
>  			continue;
>  		nfs_mark_return_delegation(server, delegation);
>  	}

The clearing of the bit here is 100% intentional. This is a variant on
basic mark-and-sweep garbage collection where if the bit hasn't been set
again the next time we scan, then we assume the delegation isn't being
used.

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  reply	other threads:[~2012-12-13 14:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-13  6:37 ycnian
2012-12-13 14:34 ` Myklebust, Trond [this message]
     [not found]   ` <CAC5OsZMOQSD2dor-TRcrmwk5t3aupwmX-WB7dbxDryKYjWPcSw@mail.gmail.com>
2012-12-14 17:45     ` Myklebust, Trond

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FA345DA4F4AE44899BD2B03EEEC2FA91192A73F@SACEXCMBX04-PRD.hq.netapp.com \
    --to=trond.myklebust@netapp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=ycnian@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®