From: "Robert Rappaport" <robert.rappaport@gmail.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: linux-fsdevel@vger.kernel.org,
David Teigland <teigland@redhat.com>,
nfs@lists.sourceforge.net, Marc Eshel <eshel@almaden.ibm.com>,
Trond Myklebust <trond.myklebust@fys.uio.no>
Subject: Re: [PATCH] locks: provide a file lease method enabling cluster-coherent leases
Date: Tue, 5 Jun 2007 18:04:57 -0400 [thread overview]
Message-ID: <f0a71180706051504j712f7415vc82682e0958a2239@mail.gmail.com> (raw)
In-Reply-To: <20070604135920.GA2233@fieldses.org>
[-- Attachment #1.1: Type: text/plain, Size: 2723 bytes --]
I have had some previous communications with Bruce on these topics, and I am
generally pleased with the proposed modifications that are presented here.
I am working on a clustered file system and there is one small additional
modification that would be of great use to me. That would be to export the
__setlease symbol.
In my implementation, my file system specific set_lease() function first
determines whether the granting of the requested lease on the given inode is
compatible with the cluster state of this inode, and then if it is, I simply
invoke the __setlease() routine and have the kernel build the associated
infrastructure.
Having this symbol globally available greatly simplifies things.
On 6/4/07, J. Bruce Fields <bfields@fieldses.org> wrote:
>
> On Sat, Jun 02, 2007 at 02:21:22PM -0400, Trond Myklebust wrote:
> > Currently, the lease handling is done all in the VFS, and is done prior
> > to calling any filesystem operations. Bruce's break_lease() inode
> > operation allows the VFS to notify the filesystem that some operation is
> > going to be called that requires the lease to be broken.
> >
> > My point is that in doing so, you are not atomic with the operation that
> > requires the lease to be broken. Some different node may re-establish a
> > lease while we're calling back down into the filesystem to perform the
> > operation.
> > So I agree with you. The break_lease() inode operation isn't going to
> > work. The filesystem is going to have to figure out for itself when it
> > needs to notify other nodes that the lease needs breaking, and it needs
> > to figure out its own methods for ensuring atomicity.
>
> OK, I agree with you both, thanks for the explanations.
>
> It looks to me like there's probably a race in the existing code that
> will allow conflicting opens and leases to be granted simultaneously if
> the lease request is handled just after may_open() is called. These
> checks at the beginning of __setlease() are an attempt to prevent that
> race:
>
> if ((arg == F_RDLCK) && (atomic_read(&inode->i_writecount) > 0))
> goto out;
> if ((arg == F_WRLCK)
> && ((atomic_read(&dentry->d_count) > 1)
> || (atomic_read(&inode->i_count) > 1)))
> goto out;
>
> But, for example, in the case of a simultaneous write open and RDLCK
> lease request, I believe the call to setlease could come after the
> may_open() but before the call to get_write_access() that bumps
> i_writecount.
>
> --b.
> -
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
[-- Attachment #1.2: Type: text/html, Size: 3691 bytes --]
[-- Attachment #2: Type: text/plain, Size: 286 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
[-- Attachment #3: Type: text/plain, Size: 140 bytes --]
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
next prev parent reply other threads:[~2007-06-05 22:04 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 [this message]
2007-06-05 22:53 ` 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 ` (unknown), J. Bruce Fields
2007-06-08 22:14 ` (no subject) 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 ` [PATCH 5/5] nfs: disable leases over NFS J. Bruce Fields
2007-06-08 22:14 ` 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=f0a71180706051504j712f7415vc82682e0958a2239@mail.gmail.com \
--to=robert.rappaport@gmail.com \
--cc=bfields@fieldses.org \
--cc=eshel@almaden.ibm.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=nfs@lists.sourceforge.net \
--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 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).