From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: syncing a single fs, and invalidate_bdev() Date: Tue, 20 Jul 2010 16:27:21 +0200 Message-ID: <20100720142720.GD3657@quack.suse.cz> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: Sage Weil Return-path: Received: from cantor2.suse.de ([195.135.220.15]:39347 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758440Ab0GTO1q (ORCPT ); Tue, 20 Jul 2010 10:27:46 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hi, On Fri 16-07-10 14:09:24, Sage Weil wrote: > I'd like to sync a single fs/superblock from userland. sync(2) is too > heavyweight since it syncs all supers. The only thing I see is the > BLKFLSBUF ioctl. That will fsync_bdev() (which does sync the super), and > then does invalidate_bdev(). > > Is that the right thing to do? Is there any issue with calling > invalidate_bdev() under a running fs? Do any normal block file systems > use the bdev's mapping for non-dirty data? BLKFLSBUF is safe under all conditions. The bad thing is that it frees the caches as well which you may not want. But looking at the code I don't see a way how to sync a single filesystem in some other way from userspace... Honza -- Jan Kara SUSE Labs, CR