Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 23 Jul 2002 14:03:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 23 Jul 2002 14:03:07 -0400 Received: from ns.suse.de ([213.95.15.193]:41230 "EHLO Cantor.suse.de") by vger.kernel.org with ESMTP id ; Tue, 23 Jul 2002 14:03:00 -0400 Date: Tue, 23 Jul 2002 20:06:04 +0200 From: Andi Kleen To: Gregory Giguashvili Cc: "'Andi Kleen'" , linux-kernel@vger.kernel.org Subject: Re: Problem with msync system call Message-ID: <20020723200604.A10501@wotan.suse.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.22.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1076 Lines: 26 On Tue, Jul 23, 2002 at 08:45:07PM +0200, Gregory Giguashvili wrote: > >Do a F_SETFL lock/unlock on the file That should act as a > >full NFS write barrier and flush all buffers. Best is if you synchronize > >between the various writers with the full lock. > > Do you mean F_SETLK? If so, this didn't help (the source is attached). F_SETLK sorry. You need to do it on both reader and writer. On the writer it acts like a fsync(), on the reader it should clear the cache. I think the problem in your case is that you have the pages mmaped. NFS uses invalidate_inode_pages() to throw away the cache, but that doesn't work when the pages are mapped. It may work to munmap/mmap around the locking. In theory with rmap (=2.5) the kernel could do that unmap/remap for you, but it will be probably non trivial to implement. -Andi - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/