]> git.hungrycats.org Git - linux/commitdiff
[PATCH] reiserfs pinned buffer fix
authorAndrew Morton <akpm@osdl.org>
Tue, 18 Nov 2003 16:15:00 +0000 (08:15 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Tue, 18 Nov 2003 16:15:00 +0000 (08:15 -0800)
From: Oleg Drokin <green@linuxhacker.ru>

reiserfs shouldn't be holding a ref against a buffer when running
set_blocksize(): it means that truncate_inode_pages() cannot free that page.

Which is not fatal - the page will drift aimlessly down the LRU until the VM
nails it.   But it's better this way.

fs/reiserfs/super.c

index b5926f9117765175f46f301696e51cc533ed1e03..da56ee11aa16cb1a3b4dca74c676e7e8f48d8062 100644 (file)
@@ -942,6 +942,7 @@ static int read_super_block (struct super_block * s, int offset)
 {
     struct buffer_head * bh;
     struct reiserfs_super_block * rs;
+    int fs_blocksize;
  
 
     bh = sb_bread (s, offset / s->s_blocksize);
@@ -961,8 +962,9 @@ static int read_super_block (struct super_block * s, int offset)
     //
     // ok, reiserfs signature (old or new) found in at the given offset
     //    
-    sb_set_blocksize (s, sb_blocksize(rs));
+    fs_blocksize = sb_blocksize(rs);
     brelse (bh);
+    sb_set_blocksize (s, fs_blocksize);
     
     bh = sb_bread (s, offset / s->s_blocksize);
     if (!bh) {