From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andi Kleen Subject: Re: [PATCH 0/9] some fixes for bugs spotted by valgrind Date: Fri, 3 Jun 2011 01:26:36 +0200 Message-ID: <20110602232636.GJ27166@one.firstfloor.org> References: <1306790348-9553-1-git-send-email-slyfox@gentoo.org> <20110531221037.0454f16e@sf> <20110603001325.4a64b7c3@sf> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andi Kleen , Chris Mason , linux-btrfs@vger.kernel.org To: Sergei Trofimovich Return-path: In-Reply-To: <20110603001325.4a64b7c3@sf> List-ID: > bh = btrfs_read_dev_super(fs_devices->latest_bdev); > if (!bh) { > err = -EINVAL; > goto fail_alloc; > } > > memcpy(&fs_info->super_copy, bh->b_data, sizeof(fs_info->super_copy)); > memcpy(&fs_info->super_for_commit, &fs_info->super_copy, > sizeof(fs_info->super_for_commit)); > brelse(bh); > > But the way superblocks are written look racy. FWIW for my ext4 checksumming work I had to add an extra lock to stabilize the super block (and the inodes) during checksumming. Maybe something similar is needed here too. -Andi -- ak@linux.intel.com -- Speaking for myself only.