Re: [PATCH 2 of 8] Change O_DIRECT to use placeholders instead of i_mutex/i_alloc_sem locking

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

 



On Wed, Feb 07, 2007 at 03:11:02PM -0500, Zach Brown wrote:

[ cleanups, sure ]

> >+		if (inode->i_mapping->nrpages ||
> >+		    mapping_mapped(inode->i_mapping))
> >+			dio->fspages_span = DIO_PAGES;
> >+		else
> >+			dio->fspages_span = ULONG_MAX;
> 
> Couldn't the decision to use DIO_PAGES in the presence of a mapping  
> race with establishing a mapping?  I fear we have to use DIO_PAGES  
> all the time, which at least has the benefit of getting rid of the  
> _span member of dio :).

The test case Linus sent me boils down to this:

fd = open(file)
buffer = mmap(fd, 128 pages);
close(fd);
fd = open(file, O_DIRECT);
write(fd, buffer, 66 pages);

I think the deadlock is limited to cases where get_user_pages will get
stuck in filemap_nopage waiting for placeholders inserted by this DIO.
It looks like that can only happen when buffer is mapped at the start of
the dio.  Outside of some futuristic async syscall system, are
there ways for the buffer to get mmaped during the DIO?

-chris

-
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