public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Loopback mounts should update the mtime of the underlying file on writes
@ 2007-11-06  1:09 Matt Mackall
  2007-11-06  2:52 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Matt Mackall @ 2007-11-06  1:09 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

Noticed by a Mercurial user. I think this should fix it.

Signed-off-by: Matt Mackall <mpm@selenic.com>

Index: l/drivers/block/loop.c
===================================================================
--- l.orig/drivers/block/loop.c	2007-11-05 17:50:07.000000000 -0600
+++ l/drivers/block/loop.c	2007-11-05 19:03:51.000000000 -0600
@@ -221,6 +221,7 @@ static int do_lo_send_aops(struct loop_d
 	offset = pos & ((pgoff_t)PAGE_CACHE_SIZE - 1);
 	bv_offs = bvec->bv_offset;
 	len = bvec->bv_len;
+	file_update_time(file);
 	while (len > 0) {
 		sector_t IV;
 		unsigned size;
@@ -299,6 +300,7 @@ static int __do_lo_send_write(struct fil
 
 	set_fs(get_ds());
 	bw = file->f_op->write(file, buf, len, &pos);
+	file_update_time(file);
 	set_fs(old_fs);
 	if (likely(bw == len))
 		return 0;


-- 
Mathematics is the supreme nostalgia of our time.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Loopback mounts should update the mtime of the underlying file on writes
  2007-11-06  1:09 [PATCH] Loopback mounts should update the mtime of the underlying file on writes Matt Mackall
@ 2007-11-06  2:52 ` Andrew Morton
  2007-11-06 16:57   ` Matt Mackall
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2007-11-06  2:52 UTC (permalink / raw)
  To: Matt Mackall; +Cc: linux-kernel

On Mon, 5 Nov 2007 19:09:24 -0600 Matt Mackall <mpm@selenic.com> wrote:

> Noticed by a Mercurial user. I think this should fix it.
> 

"should".  That pitter patter sound your hear is little akpm feet running
away.

> 
> Index: l/drivers/block/loop.c
> ===================================================================
> --- l.orig/drivers/block/loop.c	2007-11-05 17:50:07.000000000 -0600
> +++ l/drivers/block/loop.c	2007-11-05 19:03:51.000000000 -0600
> @@ -221,6 +221,7 @@ static int do_lo_send_aops(struct loop_d
>  	offset = pos & ((pgoff_t)PAGE_CACHE_SIZE - 1);
>  	bv_offs = bvec->bv_offset;
>  	len = bvec->bv_len;
> +	file_update_time(file);
>  	while (len > 0) {
>  		sector_t IV;
>  		unsigned size;
> @@ -299,6 +300,7 @@ static int __do_lo_send_write(struct fil
>  
>  	set_fs(get_ds());
>  	bw = file->f_op->write(file, buf, len, &pos);
> +	file_update_time(file);
>  	set_fs(old_fs);
>  	if (likely(bw == len))
>  		return 0;

Probably makes sense, but bear in mind that we can be fairly deep in
filesystem A functions here, and file_update_time() can do stuff like
starting journal transactions on filesystem B.

I expect the worst we'll see is not-yet-suppressed lockdep warnings and
possibly extra stack windup, but this patch may end up being more complex
than one expects..


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Loopback mounts should update the mtime of the underlying file on writes
  2007-11-06  2:52 ` Andrew Morton
@ 2007-11-06 16:57   ` Matt Mackall
  0 siblings, 0 replies; 3+ messages in thread
From: Matt Mackall @ 2007-11-06 16:57 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

On Mon, Nov 05, 2007 at 06:52:41PM -0800, Andrew Morton wrote:
> On Mon, 5 Nov 2007 19:09:24 -0600 Matt Mackall <mpm@selenic.com> wrote:
> 
> > Noticed by a Mercurial user. I think this should fix it.
> > 
> 
> "should".  That pitter patter sound your hear is little akpm feet running
> away.

Well I did actually test it.

> > Index: l/drivers/block/loop.c
> > ===================================================================
> > --- l.orig/drivers/block/loop.c	2007-11-05 17:50:07.000000000 -0600
> > +++ l/drivers/block/loop.c	2007-11-05 19:03:51.000000000 -0600
> > @@ -221,6 +221,7 @@ static int do_lo_send_aops(struct loop_d
> >  	offset = pos & ((pgoff_t)PAGE_CACHE_SIZE - 1);
> >  	bv_offs = bvec->bv_offset;
> >  	len = bvec->bv_len;
> > +	file_update_time(file);
> >  	while (len > 0) {
> >  		sector_t IV;
> >  		unsigned size;
> > @@ -299,6 +300,7 @@ static int __do_lo_send_write(struct fil
> >  
> >  	set_fs(get_ds());
> >  	bw = file->f_op->write(file, buf, len, &pos);
> > +	file_update_time(file);
> >  	set_fs(old_fs);
> >  	if (likely(bw == len))
> >  		return 0;
> 
> Probably makes sense, but bear in mind that we can be fairly deep in
> filesystem A functions here, and file_update_time() can do stuff like
> starting journal transactions on filesystem B.

I think that can alread happen, no? Especially if we're filling in
holes.

-- 
Mathematics is the supreme nostalgia of our time.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-11-06 16:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-06  1:09 [PATCH] Loopback mounts should update the mtime of the underlying file on writes Matt Mackall
2007-11-06  2:52 ` Andrew Morton
2007-11-06 16:57   ` Matt Mackall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox