From: Dan Magenheimer Subject: RE: [PATCH V4 4/8] Cleancache: VFS hooks for cleancache Date: Mon, 30 Aug 2010 17:48:17 -0700 (PDT) Message-ID: <37115137-2233-4b7f-b4d7-6d8ee07210e0@default> References: <20100830223203.GA1296@ca-server1.us.oracle.com 4C7C35F5.6040508@goop.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Cc: Chris Mason , viro@zeniv.linux.org.uk, akpm@linux-foundation.org, adilger@sun.com, tytso@mit.edu, mfasheh@suse.com, Joel Becker , matthew@wil.cx, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com, linux-mm@kvack.org, ngupta@vflare.org, JBeulich@novell.com, Kurt Hackel , npiggin@kernel.dk, Dave Mccracken , riel@redhat.com, avi@redhat.com, Konrad Wilk , mel@csn.ul.ie, yinghan@google.com, gthelen@google.com To: Jeremy Fitzhardinge Return-path: In-Reply-To: <4C7C35F5.6040508@goop.org> Sender: owner-linux-mm@kvack.org List-Id: linux-ext4.vger.kernel.org > > +=09=09if (s->cleancache_poolid >=3D 0) { > > +=09=09=09int cleancache_poolid =3D s->cleancache_poolid; >=20 > That's a lot of characters for a local in a 3-line scope. :-) OK. =20 > > +=09=09=09s->cleancache_poolid =3D -1; /* avoid races */ >=20 > Races with what? Something else sneaking something into the pool after > the flush? Is the filesystem dead at this stage or not? If there are any inodes in the page cache that point to this superblock, a cleancache_put_page may happen asynchronously that grabs from page->...->i_sb->cleancache_poolid. If the cleancache_flush_fs races with it and another cleancache_init_fs happens after the cleancache_put_page gets the poolid, the poolid could be stale. Highly unlikely, but I thought it best to be safe. > > +=09/* 99% of the time, we don't need to flush the cleancache on the > bdev. > > +=09 * But, for the strange corners, lets be cautious > > +=09 */ >=20 > This comment-style is... unconventional for the kernel. Yeah, I decided to defer to Chris Mason's wisdom and left it. :-) -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org