public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruen@suse.de>
To: Akinobu Mita <amgta@yacht.ocn.ne.jp>, Andrew Morton <akpm@zip.com.au>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mb_cache_shrink() frees unexpected caches
Date: Fri, 15 Jul 2005 16:36:27 +0200	[thread overview]
Message-ID: <200507151636.27532.agruen@suse.de> (raw)
In-Reply-To: <1121434894.1261.4.camel@localhost.localdomain>

On Friday 15 July 2005 15:41, Akinobu Mita wrote:
> > > --- 2.6-rc/fs/mbcache.c.orig	2005-07-14 20:40:34.000000000 +0900
> > > +++ 2.6-rc/fs/mbcache.c	2005-07-14 20:43:42.000000000 +0900
> > > @@ -329,7 +329,7 @@ mb_cache_shrink(struct mb_cache *cache,
> > >  	list_for_each_safe(l, ltmp, &mb_cache_lru_list) {
> > >  		struct mb_cache_entry *ce =
> > >  			list_entry(l, struct mb_cache_entry, e_lru_list);
> > > -		if (ce->e_bdev == bdev) {
> > > +		if (ce->e_cache == cache && ce->e_bdev == bdev) {
> > >  			list_move_tail(&ce->e_lru_list, &free_list);
> > >  			__mb_cache_entry_unhash(ce);
> > >  		}
> >
> > this patch looks bogus to me. How could the cache contain entries for the
> > same block_device from different file systems? The block_device is
> > sufficient to identify the file system, and hence its cache entries.
>
> Why is mb_cache_shrink() declared as:
>
> void
> mb_cache_shrink(struct mb_cache *cache, struct block_device *bdev);
>
> The variable cache was never used.

The cache parameter could indeed be removed. Not that it would matter much...

Thanks,
Andreas.

------------------------------- 8< -------------------------------
Remove unused mb_cache_shrink parameter

The cache parameter to mb_cache_shrink isn't used. We may as well
remove it.

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>

Index: linux-2.6.13-rc1/fs/ext2/xattr.c
===================================================================
--- linux-2.6.13-rc1.orig/fs/ext2/xattr.c
+++ linux-2.6.13-rc1/fs/ext2/xattr.c
@@ -823,7 +823,7 @@ cleanup:
 void
 ext2_xattr_put_super(struct super_block *sb)
 {
-	mb_cache_shrink(ext2_xattr_cache, sb->s_bdev);
+	mb_cache_shrink(sb->s_bdev);
 }
 
 
Index: linux-2.6.13-rc1/fs/ext3/xattr.c
===================================================================
--- linux-2.6.13-rc1.orig/fs/ext3/xattr.c
+++ linux-2.6.13-rc1/fs/ext3/xattr.c
@@ -1106,7 +1106,7 @@ cleanup:
 void
 ext3_xattr_put_super(struct super_block *sb)
 {
-	mb_cache_shrink(ext3_xattr_cache, sb->s_bdev);
+	mb_cache_shrink(sb->s_bdev);
 }
 
 /*
Index: linux-2.6.13-rc1/fs/mbcache.c
===================================================================
--- linux-2.6.13-rc1.orig/fs/mbcache.c
+++ linux-2.6.13-rc1/fs/mbcache.c
@@ -316,11 +316,10 @@ fail:
  * currently in use cannot be freed, and thus remain in the cache. All others
  * are freed.
  *
- * @cache: which cache to shrink
  * @bdev: which device's cache entries to shrink
  */
 void
-mb_cache_shrink(struct mb_cache *cache, struct block_device *bdev)
+mb_cache_shrink(struct block_device *bdev)
 {
 	LIST_HEAD(free_list);
 	struct list_head *l, *ltmp;
Index: linux-2.6.13-rc1/include/linux/mbcache.h
===================================================================
--- linux-2.6.13-rc1.orig/include/linux/mbcache.h
+++ linux-2.6.13-rc1/include/linux/mbcache.h
@@ -29,7 +29,7 @@ struct mb_cache_op {
 
 struct mb_cache * mb_cache_create(const char *, struct mb_cache_op *, size_t,
 				  int, int);
-void mb_cache_shrink(struct mb_cache *, struct block_device *);
+void mb_cache_shrink(struct block_device *);
 void mb_cache_destroy(struct mb_cache *);
 
 /* Functions on cache entries */

  reply	other threads:[~2005-07-15 14:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-14 13:07 [PATCH] mb_cache_shrink() frees unexpected caches Akinobu Mita
2005-07-15 10:49 ` Andreas Gruenbacher
2005-07-15 13:41   ` Akinobu Mita
2005-07-15 14:36     ` Andreas Gruenbacher [this message]
2005-07-15 15:07       ` Akinobu Mita
2005-07-15 15:30         ` Akinobu Mita
2005-07-16  1:44         ` Andreas Gruenbacher
2005-07-16  3:53           ` Akinobu Mita

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200507151636.27532.agruen@suse.de \
    --to=agruen@suse.de \
    --cc=akpm@zip.com.au \
    --cc=amgta@yacht.ocn.ne.jp \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox