[PATH] [2.5] reiserfs: fix problem when fs is out of space

From: Oleg Drokin (green_at_namesys.com)
Date: 07/31/03

  • Next message: Oleg Drokin: "[PATCH] [2.5] reiserfs: fix races between link and unlink on same file"
    Date:	Thu, 31 Jul 2003 18:40:04 +0400
    To: akpm@osdl.org
    
    

    Hello!

        This patch fixes various bad stuff that happens when you write to full or almost full
        reiserfs filesystem.

    ===== fs/reiserfs/bitmap.c 1.27 vs edited =====
    --- 1.27/fs/reiserfs/bitmap.c Fri Jul 11 09:22:55 2003
    +++ edited/fs/reiserfs/bitmap.c Thu Jul 31 18:01:52 2003
    @@ -910,11 +910,11 @@
     int reiserfs_can_fit_pages ( struct super_block *sb /* superblock of filesystem
                                                            to estimate space */ )
     {
    - b_blocknr_t space;
    + int space;
     
             spin_lock(&REISERFS_SB(sb)->bitmap_lock);
             space = (SB_FREE_BLOCKS(sb) - REISERFS_SB(sb)->reserved_blocks) >> ( PAGE_CACHE_SHIFT - sb->s_blocksize_bits);
             spin_unlock(&REISERFS_SB(sb)->bitmap_lock);
     
    - return space;
    + return space>0?space:0;
     }
    ===== fs/reiserfs/file.c 1.20 vs edited =====
    --- 1.20/fs/reiserfs/file.c Wed Jun 4 11:50:34 2003
    +++ edited/fs/reiserfs/file.c Thu Jul 31 18:01:37 2003
    @@ -1085,6 +1085,8 @@
                 // 100% of disk space anyway.
                 write_bytes = min_t(int, count, inode->i_sb->s_blocksize - (pos & (inode->i_sb->s_blocksize - 1)));
                 num_pages = 1;
    + // No blocks were claimed before, so do it now.
    + reiserfs_claim_blocks_to_be_allocated(inode->i_sb, 1 << (PAGE_CACHE_SHIFT - inode->i_blkbits));
             }
     
             /* Prepare for writing into the region, read in all the
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Oleg Drokin: "[PATCH] [2.5] reiserfs: fix races between link and unlink on same file"

    Relevant Pages

    • Re: XFS breakage in 2.6.18-rc1
      ... system disk too who had to take the hit. ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: How to run an a.out file in a kernel module
      ... called in a kernel module using call_usermodehelper ... Please read the FAQ at http://www.tux.org/lkml/ ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
      (Linux-Kernel)
    • Re: XFS Bug null pointer dereference in xfs_free_ag_extent
      ... I also filed bug 6877 at kernel.org ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: [patch] remove unused acct variables from task_struct
      ... struct mempolicy *mempolicy; ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: DIPC alpha2 for i386, Alpha, SPARC, and M68k
      ... there seems to be a delay on cs.uwindsor.ca between the time you upload something and the time it actually shows up on the page. ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)