Re: [Patch] pipe: use file_update_time() when hold i_mutex

From: Miklos Szeredi
Date: Tue Jul 21 2009 - 07:09:51 EST


On Tue, 2009-07-21 at 18:07 +0800, Amerigo Wang wrote:
> Andrew Morton wrote:
> > On Mon, 6 Jul 2009 01:35:30 -0400
> > Amerigo Wang <amwang@xxxxxxxxxx> wrote:
> >
> >
> >> file_update_time() should be called with i_mutex held,
> >> move it before mutex_unlock().
> >>
> >>
> >
> > Why do you believe that file_update_time() needs i_mutex?
> >
> file_update_time() modifies inode, no? :)

So does touch_atime(), yet neither needs i_mutex.

But calling file_update_time() within the locked region in pipe_write()
might make sense regardless: that way a task waiting for data would be
guaranteed to see the time change after receiving a POLLIN event for
example.

Thanks,
Miklos


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/