linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mi Jinlong <mijinlong@cn.fujitsu.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Jeff Layton <jlayton@redhat.com>,
	NFSv3 list <linux-nfs@vger.kernel.org>,
	linux-fsdevel@vger.kernel.org, ebiederm@xmission.com,
	adobriyan@gmail.com, viro@ZenIV.linux.org.uk,
	jamie@shareable.org,
	"Trond.Myklebust" <trond.myklebust@fys.uio.no>
Subject: Re: [PATCH] VFS: Unlink should revoke all outstanding leases on	file
Date: Thu, 20 May 2010 17:23:52 +0800	[thread overview]
Message-ID: <4BF4FFA8.9060408@cn.fujitsu.com> (raw)
In-Reply-To: <20100519160321.GF4581@fieldses.org>



J. Bruce Fields :
> On Wed, May 19, 2010 at 05:49:38PM +0800, Mi Jinlong wrote:
>>
>> Jeff Layton :
>>>>  /*	Check whether we can create an object with dentry child in directory
>>> This doesn't look right to me.
>>>
>>> The fcntl(2) manpage basically says that leases should be broken if the
>>> file is opened for read or write, or is truncated. unlinks don't seem
>>> to fall into either category...
>> Maybe the new one is better than before.
> 
> On a quick glance, break_lease() (with O_NONBLOCK unset, as here) should
> only return ENOMEM or ERSTARTSYS, either of which I suspect is OK.

  That's right, it's my neglect, but i'm not sure.

  As you said before, it's not sure ading break_lease() at there is right.
  I think it's necessary to find a better solution to fix the problem.

  Waiting for the best solution.

thanks,
Mi Jinlong


> 
> --b.
> 
>> --------------------------------------------------------------
>>
>> After client get one file's READ delegation through NFSv4,
>> server delete this file but don't reclaim the delegation.
>>
>> This patch add break_lease at may_delete, which can reclaim delegations.
>>
>> Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
>>
>> ---
>>  fs/namei.c |    4 ++++
>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/fs/namei.c b/fs/namei.c
>> index b86b96f..0423e19 100644
>> --- a/fs/namei.c
>> +++ b/fs/namei.c
>> @@ -1338,6 +1338,10 @@ static int may_delete(struct inode *dir,struct dentry *victim,int isdir)
>>  		return -ENOENT;
>>  	if (victim->d_flags & DCACHE_NFSFS_RENAMED)
>>  		return -EBUSY;
>> +
>> +	/* try to break leases, but no effect to delete. */
>> +	break_lease(victim->d_inode, FMODE_WRITE);
>> +
>>  	return 0;
>>  }
>>  
>> -- 
>> 1.7.0
>>


      reply	other threads:[~2010-05-20  9:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-14  9:35 [PATCH] VFS: Unlink should revoke all outstanding leases on file Mi Jinlong
     [not found] ` <4BED195F.3070504-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2010-05-14  9:58   ` Jeff Layton
2010-05-14 17:17     ` Trond Myklebust
     [not found]       ` <1273857471.4732.7.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-05-14 17:38         ` Jeff Layton
     [not found]           ` <20100514133819.5e383485-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2010-05-14 17:46             ` Jamie Lokier
2010-05-14 18:16               ` Jeremy Allison
2010-05-19 14:06                 ` J. Bruce Fields
     [not found]                   ` <20100519140639.GB4581-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2010-05-19 16:21                     ` Jamie Lokier
2010-05-14 17:59             ` Trond Myklebust
2010-05-14 18:31               ` Trond Myklebust
     [not found]                 ` <1273861872.4732.34.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2010-05-14 19:23                   ` J. Bruce Fields
     [not found]                     ` <20100514192327.GA20192-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2010-05-19  9:46                       ` Mi Jinlong
2010-05-19 15:57                         ` J. Bruce Fields
     [not found]                           ` <20100519155700.GE4581-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2010-05-20  9:46                             ` Mi Jinlong
     [not found]                               ` <4BF504DE.7010804-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2010-05-21 21:07                                 ` J. Bruce Fields
     [not found]                                   ` <20100521210738.GK11675-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2010-05-25 10:14                                     ` Mi Jinlong
2010-05-19 16:14                     ` Jamie Lokier
     [not found]                       ` <20100519161419.GB1693-yetKDKU6eevNLxjTenLetw@public.gmane.org>
2010-05-20  2:21                         ` J. Bruce Fields
     [not found]     ` <20100514055844.109d2fdc-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2010-05-19  9:49       ` Mi Jinlong
2010-05-19 16:03         ` J. Bruce Fields
2010-05-20  9:23           ` Mi Jinlong [this message]

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=4BF4FFA8.9060408@cn.fujitsu.com \
    --to=mijinlong@cn.fujitsu.com \
    --cc=adobriyan@gmail.com \
    --cc=bfields@fieldses.org \
    --cc=ebiederm@xmission.com \
    --cc=jamie@shareable.org \
    --cc=jlayton@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@fys.uio.no \
    --cc=viro@ZenIV.linux.org.uk \
    /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).