All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bryan Schumaker <bjschuma@netapp.com>
To: "J. Bruce Fields" <bfields@redhat.com>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: nfsd grace period open owners
Date: Wed, 28 Sep 2011 14:06:16 -0400	[thread overview]
Message-ID: <4E836218.6000805@netapp.com> (raw)

Hi Bruce,

I'm updating my fault injection patches to work with your recent stateid changes, and I had a question about something I'm seeing on the server.  When I reboot the server it will enter a grace period and reply to any OPEN requests from the client with NFSERR_GRACE.  I used Wireshark to see that NFSERR_GRACE is returned 12 times before the open succeeds, so 13 OPEN requests total.  When I send the command to forget all open owners I find that 13 open owners have been forgotten, but I only expecting to find 1.  Is this what you would expect the server to do?

I've pasted the code I use to count and delete open owners below.  The variable "num" has the value 0, so all open owners should be deleted.

- Bryan

static int nfsd_forget_n_openowners(u64 num)
{
	int i, count = 0;
	struct nfs4_stateowner *sop, *next;

	for (i = 0; i < OPEN_OWNER_HASH_SIZE; i++) {
		list_for_each_entry_safe(sop, next, &open_ownerstr_hashtbl[i], so_strhash) {
			release_openowner(openowner(sop));
			if (++count == num)
				return count;
		}
	}
	return count;
}

void nfsd_forget_openowners(u64 num)
{
	int count;

	nfs4_lock_state();
	count = nfsd_forget_n_openowners(num);
	nfs4_unlock_state();

	printk(KERN_INFO "%s %s Forgot %d open owners", __FILE__, __func__, count);
}

             reply	other threads:[~2011-09-28 18:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-28 18:06 Bryan Schumaker [this message]
2011-09-28 18:23 ` nfsd grace period open owners J. Bruce Fields
2011-09-28 18:43   ` Bryan Schumaker
2011-09-28 19:09     ` J. Bruce Fields

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=4E836218.6000805@netapp.com \
    --to=bjschuma@netapp.com \
    --cc=bfields@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.