Considering remove spinlock around f_op->setlease()

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

 



Hi guys,

Since 2.6.37 (commit 72f98e72), f_op->setlease() is called with a
spinlock held (file_lock_lock).
This removed BKL but also made distributed filesystems very difficult
to implement leasing, which
typically needs to sleep for network communications (considering the cifs case).

Commit 1c8c601a changes this into inode->i_lock but it's still a
spinlock. And since i_lock is widely
used. The f_op->setlease() implementer needs to be even more careful
to avoid a recursive spinlock in
calling other VFS functions.

So would you consider to remove the spinlock around f_op->setlease()?
I believe here the spinlock is
used to protect the returned "struct file_lock **flp".  I think it
could be acquired in the enter of
generic_setlease() but not be released if (and only if) the
generic_setlease() returned successfully.

This can make the filesystems do anything they want before calling
generic_setlease(). Of course
the code after generic_setlease() still need to be careful, but it's
much easier. Especially, if there
are any errors happened, the filesystem need to release the lock
explicity and then call __break_lease().

Or we can simply change spinlock into mutex, or any mechanism which is
safe for sleeping?

Copy to Jeff and Arnd who were working on that lock. Also Miklos, yes,
it's still me, the one was
worked on fuse adaptive readdir_plus....now I'm working for GPFS....

-- Feng Shuo
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux