From: Miklos S. <mi...@sz...> - 2014-01-31 16:28:02
|
On Thu, Jan 30, 2014 at 10:42:06AM +0400, Maxim Patlasov wrote: > >One bigger issue I found is ctime handling. Ctime is updated along > >with mtime on each data modification (write, truncate, hole-punch), > >but is also updated on chmod, chown, link, unlink, rename, setxattr, > >removexattr. > > > >Could you please look into this? > > Yes, I've already thought about it. So far as we update i_size and > mtime locally, without immediate flush to the server, we have to > handle ctime similarly as well. The server may not have actual info > about mtime and ctime, so we must honour local, not server ctime, on > fuse_getattr(). And of course all those guys modifying metadata > (chmod, etc.) must update local ctime properly. All this (at least > at first glance) is doable, but flushing ctime to the server will > require API extestion: 1) add ctime and ctimensec fields to struct > fuse_setattr_in; 2) add #define for FATTR_CTIME. Are you OK about > it? Good point. One other issue: in case fc->atomic_o_trunc is set FUSE_I_MTIME_DIRTY won't be cleared on open(O_TRUNC), AFAICS. And adding a clear_bit() to fuse_finish_open() is not enough, but need to hold i_mutex across such opens to make it work race free. I don't see problems with getting i_mutex for open(O_TRUNC) and it's already held for open(O_CREAT|O_TRUNC). Thanks, Miklos |