linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Staubach <staubach@redhat.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-fsdevel@vger.kernel.org,
	"J. Bruce Fields" <bfields@citi.umich.edu>,
	Trond Myklebust <Trond.Myklebust@netapp.com>
Subject: Re: [PATCH 6/6] nfs: disable leases over NFS
Date: Fri, 29 Jun 2007 17:16:19 -0400	[thread overview]
Message-ID: <468576A3.3000809@redhat.com> (raw)
In-Reply-To: <11831448913779-git-send-email-bfields@fieldses.org>

J. Bruce Fields wrote:
> 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 -EOPNOTSUPP.
>
> 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>
> Cc: Trond Myklebust <Trond.Myklebust@netapp.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..97c1a3d 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 -EOPNOTSUPP;
> +}
>   

A couple of things --

First, there is already some support to disable leases for NFS mounted
file systems in -mm, I think.  Are you planning on removing it?

Second, it seems to me that EINVAL would be a better error to return
than EOPNOTSUPP.  This is an invalid operation to apply to this file
and might match POSIX style specs better.

    Thanx...

       ps

  reply	other threads:[~2007-06-29 21:16 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-29 19:21 vfs lease api J. Bruce Fields
     [not found] ` <6e0beaf3e950494a6903571f0b5c9b61fc7bf650.1183143819.git.bfields@citi.umich.edu>
2007-06-29 19:21   ` [PATCH 1/6] locks: share more common lease code J. Bruce Fields
     [not found]   ` <dc828b771d2a4b78d59bdbe3c583b81887205cab.1183143820.git.bfields@citi.umich.edu>
2007-06-29 19:21     ` [PATCH 3/6] locks: rename lease functions to reflect locks.c conventions J. Bruce Fields
2007-06-30  9:22     ` Christoph Hellwig
2007-07-04 21:42       ` J. Bruce Fields
     [not found]   ` <b057dca3f8acb125eccdce3a3b84ff04713fea7c.1183143820.git.bfields@citi.umich.edu>
2007-06-29 19:21     ` [PATCH 4/6] locks: fix locks.c lease symbol exports J. Bruce Fields
2007-06-30  9:23     ` Christoph Hellwig
2007-07-04 21:42       ` J. Bruce Fields
     [not found]   ` <1bdef6b017f0ccb94ed76dbdd2b4cc676e5ef312.1183143820.git.bfields@citi.umich.edu>
2007-06-29 19:21     ` [PATCH 5/6] gfs2: stop giving out non-cluster-coherent leases J. Bruce Fields
2007-06-30  9:27     ` Christoph Hellwig
2007-07-01 15:00       ` J. Bruce Fields
2007-07-04 21:48       ` J. Bruce Fields
     [not found]   ` <ce5021881e67029f0e3d6f24109cf2953a0edcd1.1183143820.git.bfields@citi.umich.edu>
2007-06-29 19:21     ` [PATCH 6/6] nfs: disable leases over NFS J. Bruce Fields
2007-06-29 21:16       ` Peter Staubach [this message]
2007-06-29 21:39         ` J. Bruce Fields
2007-06-29 22:30           ` Steven Whitehouse
2007-06-29 22:21             ` J. Bruce Fields
2007-06-30  9:25     ` Christoph Hellwig
2007-07-04 23:22       ` J. Bruce Fields
2007-07-05 15:41       ` J. Bruce Fields
2007-07-11 10:20         ` Christoph Hellwig
2007-07-11 23:10           ` J. Bruce Fields
2007-06-30  9:20   ` [PATCH 1/6] locks: share more common lease code Christoph Hellwig
2007-07-03 22:17     ` J. Bruce Fields
2007-07-04  8:26       ` Christoph Hellwig
     [not found]   ` <59343fe9a0b0bdb9c39ed217185b9c0d6c7d8dae.1183143819.git.bfields@citi.umich.edu>
2007-06-29 19:21     ` [PATCH 2/6] locks: provide a file lease method enabling cluster-coherent leases J. Bruce Fields
2007-06-30  9:26     ` Christoph Hellwig

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=468576A3.3000809@redhat.com \
    --to=staubach@redhat.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=akpm@linux-foundation.org \
    --cc=bfields@citi.umich.edu \
    --cc=bfields@fieldses.org \
    --cc=linux-fsdevel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).