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]

 




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);

Yeah, though I bet the inner close/open isn't needed.

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.

Yeah.

It looks like that can only happen when buffer is mapped at the start of
the dio.

At the *start* of the dio or by the time get_user_pages() is called?

The dio and mmap() aren't serialized, are they? mmap() just sets up the vma, I thought, and will only touch the mmap_sem.

I'm fearing threads racing write(fd, buffer, ) and mmap(buffer, MAP_FIXED...).

I might just be missing the locking that serializes them. If nothing else, this should be mentioned in the comment above the code that looks like a racy test against the presence of a mapping.

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