All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@redhat.com>
To: linux-nfs@vger.kernel.org
Cc: "J. Bruce Fields" <bfields@redhat.com>
Subject: [PATCH 2/5] nfsd4: don't pretend to support write delegations
Date: Thu, 29 Jul 2010 18:21:21 -0400	[thread overview]
Message-ID: <1280442084-17867-3-git-send-email-bfields@redhat.com> (raw)
In-Reply-To: <1280442084-17867-1-git-send-email-bfields@redhat.com>

The delegation code mostly pretends to support either read or write
delegations.  However, correct support for write delegations would
require, for example, breaking of delegations (and/or implementation of
cb_getattr) on stat.  Currently all that stops us from handing out
delegations is a subtle reference-counting issue.

Avoid confusion by adding an earlier check that explicitly refuses write
delegations.

For now, though, I'm not going so far as to rip out existing
half-support for write delegations, in case we get around to using that
soon.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
 fs/nfsd/nfs4state.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 9cc3b78..c07c988 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -170,6 +170,13 @@ alloc_init_deleg(struct nfs4_client *clp, struct nfs4_stateid *stp, struct svc_f
 	struct nfs4_cb_conn *cb = &stp->st_stateowner->so_client->cl_cb_conn;
 
 	dprintk("NFSD alloc_init_deleg\n");
+	/*
+	 * Major work on the lease subsystem (for example, to support
+	 * calbacks on stat) will be required before we can support
+	 * write delegations properly.
+	 */
+	if (type != NFS4_OPEN_DELEGATE_READ)
+		return NULL;
 	if (fp->fi_had_conflict)
 		return NULL;
 	if (num_delegations > max_delegations)
-- 
1.7.0.4


  parent reply	other threads:[~2010-07-29 22:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-29 22:21 nfsd fixes for 2.6.36 J. Bruce Fields
2010-07-29 22:21 ` [PATCH 1/5] nfsd: bypass readahead cache when have struct file J. Bruce Fields
2010-07-30  8:10   ` Christoph Hellwig
2010-07-30  8:19     ` Bian Naimeng
2010-07-30  8:25       ` Christoph Hellwig
2010-07-30 15:41     ` J. Bruce Fields
2010-07-30 18:30       ` J. Bruce Fields
2010-07-31 18:18     ` J. Bruce Fields
2010-07-29 22:21 ` J. Bruce Fields [this message]
2010-07-29 22:21 ` [PATCH 3/5] nfsd4: miscellaneous process_open2 cleanup J. Bruce Fields
2010-07-29 22:21 ` [PATCH 4/5] nfsd4: fix openmode checking on IO using lock stateid J. Bruce Fields
2010-07-29 22:21 ` [PATCH 5/5] nfsd4: share file descriptors between stateid's 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=1280442084-17867-3-git-send-email-bfields@redhat.com \
    --to=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.