Re: LFS (2+GB) problems.

From: Andreas Dilger (adilger@home.com)
Date: Fri Feb 04 2000 - 11:52:22 EST

  • Next message: Jakub Jelinek: "Re: LFS (2+GB) problems."

    You write:
    > Just resently I have started messing with the lfs facilities now
    > in place in the devel kernels and I have run into a few problems.
    >
    > Here are my problems:
    >
    > o I can create files larger than 4GB BUT I cannot remove them cleanly.
    > o On a reboot e2fsck truncates any file larger than 4GB to 4GB.
    >
    > Also... the first time I ran e2fsck it complained to me about having a large
    > file on the FS... It said I needed to turn on some flag in the superblock
    > (I cant remember the name) to enable LFS support... How do I turn it on
    > if e2fsck didnt already? What is the flag named? Is there any real docs
    > on how to set up LFS in linux? I cant seem to find any.

    You didn't mention if you installed a new e2fsprogs. The latest version
    is 1.18 I believe. However, looking through the ext2 code that I have
    (2.3.34 only), it does not set the EXT2_FEATURE_RO_COMPAT_LARGE_FILE flag
    in the superblock as far as I can see, so e2fsck probably has no chance to
    get it right anyways. If it isn't already in the recent kernel, you need
    something like the following in fs/ext2/inode.c:ext2_update_inode():

            if (S_ISDIR(inode->i_mode))
                    raw_inode->i_dir_acl = cpu_to_le32(inode->u.ext2_i.i_dir_acl);
    | else {
                    raw_inode->i_size_high = cpu_to_le32(inode->i_size >> 32);
    + if (raw_inode->i_size_high)
    + inode->i_sb->u.ext2_sb.s_feature_ro_compat |=
    + EXT2_FEATURE_RO_COMPAT_LARGE_FILE;
    + }

    I'm not 100% sure this is the right way to do it (not even sure that the
    syntax is correct), but at least it's a start... It seems likely that
    you may also need to have (in addition to or instead of the above):

    + inode->i_sb->u.ext2_sb.s_es->s_feature_ro_compat |=
    + EXT2_FEATURE_RO_COMPAT_LARGE_FILE;
    + mark_buffer_dirty(inode->i_sb->u.ext2_sb.s_sbh, 1);
    + inode->i_sb->s_dirt = 1;

    The latter will change the superblock on the disk - note the s_es in there,
    and it should be written out when it is marked dirty. It may also be
    nice to check if the flag is already set via EXT2_HAS_RO_COMPAT_FEATURE()
    so we don't write out the superblock for each update of a large file...

    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 - 11:59:09 EST