[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <37115137-2233-4b7f-b4d7-6d8ee07210e0@default>
Date: Mon, 30 Aug 2010 17:48:17 -0700 (PDT)
From: Dan Magenheimer <dan.magenheimer@...cle.com>
To: Jeremy Fitzhardinge <jeremy@...p.org>
Cc: Chris Mason <chris.mason@...cle.com>, viro@...iv.linux.org.uk,
akpm@...ux-foundation.org, adilger@....com, tytso@....edu,
mfasheh@...e.com, Joel Becker <joel.becker@...cle.com>,
matthew@....cx, linux-btrfs@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-ext4@...r.kernel.org, ocfs2-devel@....oracle.com,
linux-mm@...ck.org, ngupta@...are.org, JBeulich@...ell.com,
Kurt Hackel <kurt.hackel@...cle.com>, npiggin@...nel.dk,
Dave Mccracken <dave.mccracken@...cle.com>, riel@...hat.com,
avi@...hat.com, Konrad Wilk <konrad.wilk@...cle.com>,
mel@....ul.ie, yinghan@...gle.com, gthelen@...gle.com
Subject: RE: [PATCH V4 4/8] Cleancache: VFS hooks for cleancache
> > + if (s->cleancache_poolid >= 0) {
> > + int cleancache_poolid = s->cleancache_poolid;
>
> That's a lot of characters for a local in a 3-line scope.
:-) OK.
> > + s->cleancache_poolid = -1; /* avoid races */
>
> 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.
> > + /* 99% of the time, we don't need to flush the cleancache on the
> bdev.
> > + * But, for the strange corners, lets be cautious
> > + */
>
> This comment-style is... unconventional for the kernel.
Yeah, I decided to defer to Chris Mason's wisdom and left it. :-)
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists