Re: [PATCH v2 2/3] mm: Update file times when inodes are written after mmaped writes

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

 



On Mon, Dec 31, 2012 at 8:11 AM, Jan Kara <jack@xxxxxxx> wrote:
> On Sat 22-12-12 00:43:30, Andy Lutomirski wrote:
>> On Sat, Dec 22, 2012 at 12:29 AM, Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
>> > NAK, we went through great trouble to get rid of the nasty layering
>> > violation where the VM called file_update_time directly just a short
>> > while ago, reintroducing that is a massive step back.
>> >

[...]

>
>> The original version of this patch did the update in ->writepage and
>> ->writepages, but that may have had lock ordering issues.  (I wasn't
>> able to confirm that there was any actual problem.)
>   Well, your call of mapping_flush_cmtime() from do_writepages() is easy to
> move to generic_writepages(). Thus filesystem can easily implement it's own
> ->writepages() callback if time update doesn't suit it.

That sounds fine to me.  Updating the handful of filesystems in there
isn't a big deal.

>With the call from
> remove_vma() it is more problematic (and the calling context there is
> harder as well because we hold mmap_sem). We could maybe leave the call
> upto filesystem's ->release callback (and provide generic ->release handler
> which just calls mapping_flush_cmtime()). It won't be perfect because that
> gets called only after the last file descriptor for that struct file is
> closed (i.e., if a process forks and child inherits mappings, ->release gets
> called only after both parent and the child unmap the file) but it should
> catch 99% of the real world cases. Christoph, would the be OK with
> you?

I'm not sure that 99% is good enough -- I'd be nervous about breaking
some build or versioning system.

vm_ops->close is almost a good place for this, except that it's called
on some failure paths and it will mess up is_mergeable_vma if lots of
filesystems suddenly have a ->close operation.  What about adding
vm_ops->flush, which would be called in remove_vma and possibly
msync(MS_ASYNC)?  I think that all real filesystems (i.e. things that
care about cmtime updates) have vm_operations.

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