Re: LFS (2+GB) problems.

From: Andreas Dilger (adilger@home.com)
Date: Fri Feb 04 2000 - 16:03:53 EST

  • Next message: Q: "Second Oops"

    Ben writes:
    > Actually you probably want the patch below -- only mark the super block
    > dirty if the bit wasn't already set. This is what's done in 2.2, I'm not
    > sure how I missed this -- probably because my superblock already had the
    > compat bit set... =)

    You may still want to have the flag set for the in-memory ext superblock
    as well, just in case it is required/used/modified elsewhere. Even though
    we are changing the superblock, I don't think we need to hold the superblock
    lock for this, as it is "only" changing a bit in a very rarely used field.
    However, it might be prudent to add lock_super(sb) and unlock_super(sb) if
    the flag is being set for the first time.

    I didn't see this code in 2.2.14 or 2.3.34, so it is probably a good idea
    for Ben to submit this to Alan + Stephen for inclusion in both kernels.

    > Index: linux/fs/ext2/inode.c
    > ===================================================================
    > RCS file: /home/bcrl/CVSROOT/kernel/linux/fs/ext2/inode.c,v
    > retrieving revision 1.1.1.1
    > diff -u -u -r1.1.1.1 inode.c
    > --- linux/fs/ext2/inode.c 2000/01/11 02:15:58 1.1.1.1
    > +++ linux/fs/ext2/inode.c 2000/02/04 19:25:59
    > @@ -699,7 +699,7 @@
    > else {
    > inode->u.ext2_i.i_dir_acl = 0;
    > inode->u.ext2_i.i_high_size = le32_to_cpu(raw_inode->i_size_high);
    > - inode->i_size |= ((__u64)le32_to_cpu(raw_inode->i_size_high)) << 32;
    > + inode->i_size |= ((__u64)inode->u.ext2_i.i_high_size) << 32;
    > }
    > inode->i_generation = le32_to_cpu(raw_inode->i_generation);
    > inode->u.ext2_i.i_block_group = block_group;
    > @@ -840,8 +840,22 @@
    > raw_inode->i_file_acl = cpu_to_le32(inode->u.ext2_i.i_file_acl);
    > if (S_ISDIR(inode->i_mode))
    > raw_inode->i_dir_acl = cpu_to_le32(inode->u.ext2_i.i_dir_acl);
    > - else
    > + else {
    > raw_inode->i_size_high = cpu_to_le32(inode->i_size >> 32);
    > + if (raw_inode->i_size_high) {
    > + struct super_block *sb = inode->i_sb;
    > + struct ext2_super_block *es = sb->u.ext2_sb.s_es;
    > + if (!(es->s_feature_ro_compat &
    > + cpu_to_le32(EXT2_FEATURE_RO_COMPAT_LARGE_FILE))){
    > + /* If this is the first large file
    > + * created, add a flag to the superblock */
    + sb->s_feature_ro_compat |=
    + EXT2_FEATURE_RO_COMPAT_LARGE_FILE;
    > + es->s_feature_ro_compat |=
    > + cpu_to_le32(EXT2_FEATURE_RO_COMPAT_LARGE_FILE);
    > + mark_buffer_dirty(sb->u.ext2_sb.s_sbh, 1);
    > + }
    > + }
    > +
    > + }
    >
    > raw_inode->i_generation = cpu_to_le32(inode->i_generation);
    > if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode))

    Cheers, Andreas

    -- 
    Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                     \  would they cancel out, leaving him still hungry?"
    http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert
    

    - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



    This archive was generated by hypermail 2b29 : Fri Feb 04 2000 - 16:15:28 EST