RE: [PATCH V4 4/8] Cleancache: VFS hooks for cleancache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > +		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-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux