Re: [PATCH] update ctime and mtime for mmaped write

2007-02-22 Thread Miklos Szeredi
> Miklos Szeredi wrote: > This still does not address the situation where a file is 'permanently' > mmap'd, does it? > > >>> So? If application doesn't do msync, then the file times won't be > >>> updated. That's allowed by the standard, and so portable applications > >>>

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-22 Thread Peter Staubach
Miklos Szeredi wrote: This still does not address the situation where a file is 'permanently' mmap'd, does it? So? If application doesn't do msync, then the file times won't be updated. That's allowed by the standard, and so portable applications will have to call msync. It is

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-22 Thread Miklos Szeredi
> > > This still does not address the situation where a file is 'permanently' > > > mmap'd, does it? > > > > So? If application doesn't do msync, then the file times won't be > > updated. That's allowed by the standard, and so portable applications > > will have to call msync. > > It is allowed

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-22 Thread Trond Myklebust
On Thu, 2007-02-22 at 21:48 +0100, Miklos Szeredi wrote: > > This still does not address the situation where a file is 'permanently' > > mmap'd, does it? > > So? If application doesn't do msync, then the file times won't be > updated. That's allowed by the standard, and so portable applications

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-22 Thread Peter Staubach
Miklos Szeredi wrote: __fput() will be called when there are no more references to 'file', then it will update the time if the flag is set. This applies to regular files as well as devices. I suspect that you will find that, for a block device, the wrong inode gets updated. That's w

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-22 Thread Peter Staubach
Miklos Szeredi wrote: Take this example: fd = open() addr = mmap(.., fd) write(fd, ...) close(fd) sleep(100) msync(addr,...) munmap(addr) The file times will be updated in write(), but with your patch, the bit in the mapping will also be set. Then in msync() the fil

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-22 Thread Miklos Szeredi
> > __fput() will be called when there are no more references to 'file', > > then it will update the time if the flag is set. This applies to > > regular files as well as devices. > > > > > > I suspect that you will find that, for a block device, the wrong inode > gets updated. That's where t

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-22 Thread Miklos Szeredi
> > Take this example: > > > > fd = open() > > addr = mmap(.., fd) > > write(fd, ...) > > close(fd) > > sleep(100) > > msync(addr,...) > > munmap(addr) > > > > The file times will be updated in write(), but with your patch, the > > bit in the mapping will also be set. >

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-22 Thread Peter Staubach
Miklos Szeredi wrote: Why is the flag checked in __fput()? It's because of this bit in the standard: If there is no such call and if the underlying file is modified as a result of a write reference, then these fields shall be marked for update at some time after the wr

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-22 Thread Peter Staubach
Miklos Szeredi wrote: +int set_page_dirty_mapping(struct page *page); This aspect of the design seems intrusive to me. I didn't see a strong reason to introduce new versions of many of the routines just to handle these semantics. What motivated this part of

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-22 Thread Miklos Szeredi
> > +int set_page_dirty_mapping(struct page *page); > > > > > > > This aspect of the design seems intrusive to me. I didn't see a strong > reason to introduce new versions of many of the routines just to handle > these semantics. What motivated

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-22 Thread Miklos Szeredi
> >> Why is the flag checked in __fput()? > >> > > > > It's because of this bit in the standard: > > > > If there is no such call and if the underlying file is modified > > as a result of a write reference, then these fields shall be > > marked for update at some time after the wri

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-22 Thread Peter Staubach
Miklos Szeredi wrote: Inspired by Peter Staubach's patch and the resulting comments. An updated version of the original patch was submitted to LKML yesterday... :-) Strange coincidence :) file = vma->vm_file; start

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-22 Thread Peter Staubach
Miklos Szeredi wrote: On Wed, 21 Feb 2007 18:51:52 +0100 Miklos Szeredi <[EMAIL PROTECTED]> wrote: This patch makes writing to shared memory mappings update st_ctime and st_mtime as defined by SUSv3: The st_ctime and st_mtime fields of a file that is mapped with MAP_SHARED and PROT_

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-21 Thread Miklos Szeredi
> On Wed, 21 Feb 2007 18:51:52 +0100 Miklos Szeredi <[EMAIL PROTECTED]> wrote: > > > This patch makes writing to shared memory mappings update st_ctime and > > st_mtime as defined by SUSv3: > > > >The st_ctime and st_mtime fields of a file that is mapped with > >MAP_SHARED and PROT_WRITE

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-21 Thread Andrew Morton
On Wed, 21 Feb 2007 18:51:52 +0100 Miklos Szeredi <[EMAIL PROTECTED]> wrote: > This patch makes writing to shared memory mappings update st_ctime and > st_mtime as defined by SUSv3: > >The st_ctime and st_mtime fields of a file that is mapped with >MAP_SHARED and PROT_WRITE shall be marke

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-21 Thread Miklos Szeredi
> >>> Inspired by Peter Staubach's patch and the resulting comments. > >>> > >>> > >>> > >> An updated version of the original patch was submitted to LKML > >> yesterday... :-) > >> > > > > Strange coincidence :) > > > > > >>> file = vma->vm_file; > >>> start

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-21 Thread Peter Staubach
Miklos Szeredi wrote: Inspired by Peter Staubach's patch and the resulting comments. An updated version of the original patch was submitted to LKML yesterday... :-) Strange coincidence :) file = vma->vm_file; start = vma->vm_end; +

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-21 Thread Miklos Szeredi
> > > > This flag is checked in msync() and __fput(), and if set, the file > > > > times are updated and the flag is cleared > > > > > > Why not also check inside vfs_getattr? > > > > This is the minimum, that the standard asks for. > > > > Note, your porposal would touch the times in vfs_getatt

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-21 Thread Peter Staubach
Trond Myklebust wrote: On Wed, 2007-02-21 at 19:28 +0100, Miklos Szeredi wrote: This flag is checked in msync() and __fput(), and if set, the file times are updated and the flag is cleared Why not also check inside vfs_getattr? This is the minimum, that the standard asks for

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-21 Thread Trond Myklebust
On Wed, 2007-02-21 at 19:28 +0100, Miklos Szeredi wrote: > > > This flag is checked in msync() and __fput(), and if set, the file > > > times are updated and the flag is cleared > > > > Why not also check inside vfs_getattr? > > This is the minimum, that the standard asks for. > > Note, your por

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-21 Thread Miklos Szeredi
> > This flag is checked in msync() and __fput(), and if set, the file > > times are updated and the flag is cleared > > Why not also check inside vfs_getattr? This is the minimum, that the standard asks for. Note, your porposal would touch the times in vfs_getattr(), which means, that the modif

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-21 Thread Miklos Szeredi
> > Inspired by Peter Staubach's patch and the resulting comments. > > > > > > An updated version of the original patch was submitted to LKML > yesterday... :-) Strange coincidence :) > > file = vma->vm_file; > > start = vma->vm_end; > > + mapping_update_tim

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-21 Thread Trond Myklebust
On Wed, 2007-02-21 at 18:51 +0100, Miklos Szeredi wrote: > From: Miklos Szeredi <[EMAIL PROTECTED]> > > This patch makes writing to shared memory mappings update st_ctime and > st_mtime as defined by SUSv3: > >The st_ctime and st_mtime fields of a file that is mapped with >MAP_SHARED and

Re: [PATCH] update ctime and mtime for mmaped write

2007-02-21 Thread Peter Staubach
Miklos Szeredi wrote: From: Miklos Szeredi <[EMAIL PROTECTED]> This patch makes writing to shared memory mappings update st_ctime and st_mtime as defined by SUSv3: The st_ctime and st_mtime fields of a file that is mapped with MAP_SHARED and PROT_WRITE shall be marked for update at some p

[PATCH] update ctime and mtime for mmaped write

2007-02-21 Thread Miklos Szeredi
From: Miklos Szeredi <[EMAIL PROTECTED]> This patch makes writing to shared memory mappings update st_ctime and st_mtime as defined by SUSv3: The st_ctime and st_mtime fields of a file that is mapped with MAP_SHARED and PROT_WRITE shall be marked for update at some point in the interval