All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@citi.umich.edu>
To: linux-fsdevel@vger.kernel.org
Cc: nfs@lists.sourceforge.net,
	Trond Myklebust <trond.myklebust@fys.uio.no>,
	David Teigland <teigland@redhat.com>,
	Marc Eshel <eshel@almaden.ibm.com>,
	Robert Rappaport <robert.rappaport@gmail.com>,
	"J. Bruce Fields" <bfields@citi.umich.edu>,
	Peter Staubach <staubach@redhat.com>
Subject: [PATCH 5/5] nfs: disable leases over NFS
Date: Fri,  8 Jun 2007 18:14:55 -0400	[thread overview]
Message-ID: <45540.106696035$1181340916@news.gmane.org> (raw)
In-Reply-To: <11813408951694-git-send-email->

From: J. Bruce Fields <bfields@citi.umich.edu>

As Peter Staubach says elsewhere
(http://marc.info/?l=linux-kernel&m=118113649526444&w=2):

> The problem is that some file system such as NFSv2 and NFSv3 do
> not have sufficient support to be able to support leases correctly.
> In particular for these two file systems, there is no over the wire
> protocol support.
>
> Currently, these two file systems fail the fcntl(F_SETLEASE) call
> accidentally, due to a reference counting difference.  These file
> systems should fail more consciously, with a proper error to
> indicate that the call is invalid for them.

Define an nfs setlease method that just returns -EINVAL.

If someone can demonstrate a real need, perhaps we could reenable
them in the presence of the "nolock" mount option.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Cc: Peter Staubach <staubach@redhat.com>
---
 fs/nfs/file.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 9eb8eb4..467671b 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -51,6 +51,7 @@ static int  nfs_fsync(struct file *, struct dentry *dentry, int datasync);
 static int nfs_check_flags(int flags);
 static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl);
 static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl);
+static int nfs_setlease(struct file *file, long arg, struct file_lock **fl);
 
 const struct file_operations nfs_file_operations = {
 	.llseek		= nfs_file_llseek,
@@ -67,6 +68,7 @@ const struct file_operations nfs_file_operations = {
 	.flock		= nfs_flock,
 	.sendfile	= nfs_file_sendfile,
 	.check_flags	= nfs_check_flags,
+	.setlease	= nfs_setlease,
 };
 
 const struct inode_operations nfs_file_inode_operations = {
@@ -555,3 +557,8 @@ static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl)
 		return do_unlk(filp, cmd, fl);
 	return do_setlk(filp, cmd, fl);
 }
+
+static int nfs_setlease(struct file *file, long arg, struct file_lock **fl)
+{
+	return -EINVAL;
+}
-- 
1.5.2


  parent reply	other threads:[~2007-06-08 22:14 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-31 21:40 cluster-coherent leases J. Bruce Fields
2007-05-31 21:40 ` [PATCH] locks: share more common lease code J. Bruce Fields
2007-05-31 21:40   ` [PATCH] locks: provide a file lease method enabling cluster-coherent leases J. Bruce Fields
2007-05-31 21:40     ` [PATCH] gfs2: stop giving out non-cluster-coherent leases J. Bruce Fields
2007-05-31 22:34     ` [PATCH] locks: provide a file lease method enabling cluster-coherent leases Trond Myklebust
2007-06-01 16:53       ` [NFS] " J. Bruce Fields
2007-06-02 17:39         ` Trond Myklebust
2007-06-02 18:09           ` Marc Eshel
2007-06-02 18:21             ` Trond Myklebust
2007-06-04 13:59               ` J. Bruce Fields
2007-06-05 22:04                 ` Robert Rappaport
2007-06-05 22:53                   ` [NFS] " Trond Myklebust
2007-06-05 22:56                   ` Marc Eshel
2007-06-05 23:40                     ` Trond Myklebust
2007-06-06 18:43                       ` Robert Rappaport
2007-06-07 14:43                         ` [NFS] " Robert Rappaport
2007-06-07 17:05                           ` J. Bruce Fields
2007-06-08 22:14                             ` (no subject) J. Bruce Fields
2007-06-08 22:14                             ` (unknown), J. Bruce Fields
     [not found]                             ` <11813408953536-git-send-email->
2007-06-08 22:14                               ` [PATCH 1/5] locks: share more common lease code J. Bruce Fields
2007-06-08 22:14                               ` J. Bruce Fields
     [not found]                               ` <11813408952518-git-send-email->
2007-06-08 22:14                                 ` [PATCH 2/5] locks: provide a file lease method enabling cluster-coherent leases J. Bruce Fields
2007-06-08 22:14                                 ` J. Bruce Fields
     [not found]                                 ` <11813408951909-git-send-email->
2007-06-08 22:14                                   ` [PATCH 3/5] locks: rename lease functions to reflect locks.c conventions J. Bruce Fields
2007-06-08 22:14                                   ` J. Bruce Fields
     [not found]                                   ` <11813408954053-git-send-email->
2007-06-08 22:14                                     ` [PATCH 4/5] gfs2: stop giving out non-cluster-coherent leases J. Bruce Fields
2007-06-08 22:14                                     ` J. Bruce Fields
     [not found]                                     ` <11813408951694-git-send-email->
2007-06-08 22:14                                       ` J. Bruce Fields [this message]
2007-06-08 22:14                                       ` [PATCH 5/5] nfs: disable leases over NFS J. Bruce Fields
2007-06-09 14:18                                       ` [PATCH 4/5] gfs2: stop giving out non-cluster-coherent leases Steven Whitehouse
2007-06-09 16:35                                         ` Marc Eshel
2007-06-11  9:38                                           ` Steven Whitehouse
2007-06-11 17:07                                             ` J. Bruce Fields
2007-06-09 16:56                                     ` [PATCH 3/5] locks: rename lease functions to reflect locks.c conventions Marc Eshel
2007-06-11 16:53                                       ` J. Bruce Fields
2007-06-02 18:23             ` [NFS] [PATCH] locks: provide a file lease method enabling cluster-coherent leases Trond Myklebust
2007-06-01 13:14     ` Peter Staubach
2007-06-01 16:44       ` [NFS] " J. Bruce Fields
2007-06-01 17:41         ` Matthew Wilcox
2007-06-01 18:08           ` J. Bruce Fields
2007-05-31 21:51   ` [PATCH] locks: share more common lease code Trond Myklebust
2007-06-01 16:30     ` [NFS] " J. Bruce Fields
2007-06-01 16:36       ` Trond Myklebust

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='45540.106696035$1181340916@news.gmane.org' \
    --to=bfields@citi.umich.edu \
    --cc=eshel@almaden.ibm.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=nfs@lists.sourceforge.net \
    --cc=robert.rappaport@gmail.com \
    --cc=staubach@redhat.com \
    --cc=teigland@redhat.com \
    --cc=trond.myklebust@fys.uio.no \
    /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.