On Mon 02-12-13 08:58:25, Matthew Wilcox wrote: > On Mon, Dec 02, 2013 at 09:33:18AM +0100, Jan Kara wrote: > > > Indeed, XIP could make use of the structures we already > > > have in the struct inode/address space to behave more like a normal > > > filesystem. We already use the mapping tree to store > > > per-page information that is used to serialise truncate vs page > > > faults, so why not make XIP do exactly the same thing? > > I believe that grabbing mmap_sem for writing during truncate (in case of > > ext2 around xip_truncate_page() & truncate_setsize() calls should do the > > trick. But I need to verify with lockdep that it doesn't introduce new > > locking problems. > > Umm ... mmap_sem for write? On each of the tasks that have a file mmaped? > I know we have double_down that orders by memory address, but I don't > think we have an N_down_write(). No, sorry, that was my mistake. I was thinking about threads of a single process racing but the race is there obviously for different processes as well so mmap_sem won't help us. Honza -- Jan Kara <jack@xxxxxxx> SUSE Labs, CR -- 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