Re: [PATCH] fs/locks.c fcntl_setlease did not check if a file was opened for writing before granting a read lease

From: Joseph D. Wagner
Date: Thu Nov 27 2003 - 15:51:42 EST


>> But I THINK this is how a patch would fix the problem, in theory.

> Sorry, it won't.
...
> To detect if anyone has the file open for writing, you'll a new count
> field which keeps track of writer references. Something like this:
>
> 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.

Well, dang it all. Why didn't they guy who implemented leasing in the first
place bother to do it right the first time?

I don't have the time or technical expertise in kernel development to go
through all that. Somebody else is going to have to pick up his slack.

Joseph D. Wagner

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/