Re: [PATCH v1 009/104] locks: add file_has_lease

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 23 Jun 2014 09:12:54 -0700
Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:

> On Thu, Jun 19, 2014 at 10:49:15AM -0400, Jeff Layton wrote:
> > Add a function that can tell us whether a file description has had a
> > lease set on it.
> 
> The code looks good, but how is this information useful given that it
> will be stable as soon as i_lock is dropped?
> 

The next patch is what uses it. I can squash the two together, but I
figured it was best to keep them separate since we're touching two
different subsystems here.

The basic idea here is to avoid calling vfs_setlease under a spinlock.
The next patch does that and then takes the spinlocks and hash the
delegation once the lease is set.

Problem: what if the delegation got broken before we could hash it?

The workqueue job that's queued by break_deleg will take the state_lock
spinlock before it can unhash the delegation. So, we take the
state_lock and then call file_has_lease. If the lease is still present
then we know that it hasn't been (and won't be) broken before we could
hash it.

-- 
Jeff Layton <jlayton@xxxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux