From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxim Patlasov Subject: Re: [PATCH 05/11] fuse: Trust kernel i_mtime only -v2 Date: Mon, 20 Jan 2014 15:33:37 +0400 Message-ID: <52DD0991.2000905@parallels.com> References: <20131010130718.10089.6736.stgit@dhcp-10-30-17-2.sw.ru> <20131010131051.10089.62357.stgit@dhcp-10-30-17-2.sw.ru> <20131112165251.GA10813@tucsk.piliscsaba.szeredi.hu> <52BC4E35.8040503@parallels.com> <20140106162242.GE16230@tucsk.piliscsaba.szeredi.hu> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Cc: , , , , , , , , , To: Miklos Szeredi Return-path: In-Reply-To: <20140106162242.GE16230@tucsk.piliscsaba.szeredi.hu> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On 01/06/2014 08:22 PM, Miklos Szeredi wrote: > On Thu, Dec 26, 2013 at 07:41:41PM +0400, Maxim Patlasov wrote: >>>> + >>>> + if (!err) >>>> + clear_bit(FUSE_I_MTIME_DIRTY, &fi->state); >>> Doing the test and the clear separately opens a huge race window when i_mtime >>> modifications are bound to get lost. >> No. Because the whole operation is protected by i_mutex (see >> fuse_fsync_common()). > fuse_release_common() doesn't have i_mutex. It's probably safe to acquire it, > but is that really needed? No, that's not needed, I think. Because by the time of calling fuse_release(), file->f_count is already zero and no userspace activity is possible on the file. Are you OK about -v3 version of the patch (sent 12/26/2013)? Thanks, Maxim > > Thanks, > Miklos >