Messages in this thread | ![/](/images/icornerl.gif) | | Date | Wed, 3 Dec 2003 02:02:40 +0000 | From | Jamie Lokier <> | Subject | Re: [PATCH] fs/locks.c fcntl_setlease did not check if a file was opened for writing before granting a read lease |
| |
Sean Neakums wrote: > > if ((arg == F_RDLCK) > > && ((atomic_read(&inode->i_writer_count) != 0))) > > > > You'll also need to modify all the places where that needs to be > > maintained. > > Looking at 2.6.0-test11, it seems that its struct inode has such a > field, albeit named i_writecount. Commentary from fs/namei.c:
Cool. At a glance, it looks like deny_write_access() can be used to handle the F_RDLCK case.
(It would also be nice to have some way of blocking until the lease can be taken, but even the F_WRLCK case doesn't offer that at the moment).
-- Jamie - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| ![\](/images/icornerr.gif) |