Re: [patch 11/13] don't hold i_sem during O_DIRECT writes to blockdevs

From: Andrew Morton (akpm@zip.com.au)
Date: Sun Jul 28 2002 - 12:55:56 EST


Christoph Hellwig wrote:
>
> On Sun, Jul 28, 2002 at 12:33:23AM -0700, Andrew Morton wrote:
> > This patch changes O_DIRECT writes to blockdevs so that they no longer
> > run under i_sem.
>
> Please don't make this depenend on S_ISBLK(). There are filesystems (like
> XFS) that are designed to safely allow concurrent O_DIRECT writes to
> regular files.
>
> Toe implement this properly we should drop i_sem in the ->direct_IO method
> of the filesystem/blockdevice. The only question remaining is whether the
> method has to reqacquire it before returing (and it'll be imediately
> released again or whether we should change semantics of ->direct_IO to
> always drop the lock.
>
> The third options would be to never call ->direct_IO with the i_sem held
> and let filesystems that need it (only ext2 in 2.5 mainline) do
> synchronization themselves.
>
> I think I prefer option 3, it's the cleanest way of doing it.

It could be time to separate out a __generic_file_write() which
doesn't take i_sem at all. The ext3 tree was doing that for a
while, to permit multipage transactions in journalled data mode.

> A little unrelated, but as you touch the code: what about removing the two
> existing special cases for S_ISBLK() in generic_file_write()? they're
> present only to provide the old (pre-LFS) blockdevice semantics on 2.4,
> we shouldn't keept them around forever..

hm. Are you sure about that? They look fairly useful to me?

-
-
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/



This archive was generated by hypermail 2b29 : Tue Jul 30 2002 - 14:00:29 EST