From: Andreas Dilger <adilger@turbolinux.com>
To: Alexander Viro <viro@math.psu.edu>
Cc: Chris Mason <mason@suse.com>, Alan Cox <alan@redhat.com>,
Stefan Traby <stefan@hello-penguin.com>,
linux-kernel@vger.kernel.org
Subject: Re: ramfs problem... (unlink of sparse file in "D" state)
Date: Mon, 8 Jan 2001 12:07:40 -0700 (MST) [thread overview]
Message-ID: <200101081907.f08J7ev15806@webber.adilger.net> (raw)
In-Reply-To: <Pine.GSO.4.21.0101081042490.4061-100000@weyl.math.psu.edu> "from Alexander Viro at Jan 8, 2001 10:47:41 am"
Al Viro writes:
> No, it doesn't. s/$/while(bh != head);/, indeed. Sorry about that -
> cut-and-waste when I did rediff to 2.4.0. Corrected patch follows:
>
> diff -urN S0-AC4/fs/ext2/super.c S0-AC4-fixes/fs/ext2/super.c
> --- S0-AC4/fs/ext2/super.c Mon Jan 8 08:46:18 2001
> +++ S0-AC4-fixes/fs/ext2/super.c Mon Jan 8 08:35:16 2001
> @@ -380,6 +380,20 @@
> }
>
> #define log2(n) ffz(~(n))
> +
> +/*
> + * maximal file size.
> + */
> +static loff_t ext2_max_size(int bits)
> +{
> + loff_t res = EXT2_NDIR_BLOCKS;
> + res += 1LL << (bits-2);
> + res += 1LL << (2*(bits-2));
> + res += 1LL << (3*(bits-2));
> + if (res > 1LL << 32)
> + res = 1LL << 32;
> + return res << bits;
> +}
Actually, this is wrong. The ext2 inode limit is 2^32 512-byte sectors,
not 2^32 blocksize blocks. Yes this is a wart and Ted wants to fix it, as
soon as we have something else important enough to require an incompatible
change to ext2. As it is, we are limited to 2TB files for now, which is no
loss because we only support 2TB devices in 2.4 anyways. When we change to
2^32 filesystem blocks, we will again be limited by indirect blocks, except
for 8kB block filesystems on Alpha/ia64 at 32TB.
+/*
+ * Maximal file size. There is a direct, and {,double-,triple-}indirect
+ * block limit, and also a limit of (2^32 - 1) 512-byte sectors in i_blocks.
+ * We need to be 1 filesystem block less than the 2^32 sector limit.
+ */
+static loff_t ext2_max_size(int bits)
+{
+ loff_t res = EXT2_NDIR_BLOCKS;
+ res += 1LL << (bits-2);
+ res += 1LL << (2*(bits-2));
+ res += 1LL << (3*(bits-2));
+ res << bits;
+ if (res > (512LL << 32) - (1 << bits))
+ res = (512LL << 32) - (1 << bits);
+ return res;
+}
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.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2001-01-08 19:08 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-01-06 4:46 Stefan Traby
2001-01-06 4:52 ` Alexander Viro
2001-01-06 5:08 ` Stefan Traby
2001-01-06 5:18 ` Alexander Viro
2001-01-06 5:24 ` modprobe ipv6 gives -1 usage count was [ramfs problem...] Stefan Traby
2001-01-06 9:55 ` Russell King
2001-01-06 11:05 ` Matti Aarnio
2001-01-06 15:35 ` Alan Cox
2001-01-06 15:35 ` ramfs problem... (unlink of sparse file in "D" state) Alan Cox
2001-01-06 15:53 ` Chris Wedgwood
2001-01-06 15:58 ` Alan Cox
2001-01-06 16:07 ` Chris Wedgwood
2001-01-07 7:05 ` Eric W. Biederman
2001-01-07 8:08 ` Chris Wedgwood
2001-01-07 14:01 ` Alan Cox
2001-01-07 13:57 ` Alan Cox
2001-01-07 14:07 ` Chris Wedgwood
2001-01-07 14:20 ` Alan Cox
2001-01-07 14:56 ` Eric W. Biederman
2001-01-08 7:56 ` Alexander Viro
2001-01-08 8:12 ` Chris Wedgwood
2001-01-08 8:41 ` [PATCH(es)] " Alexander Viro
2001-01-08 11:50 ` Alan Cox
2001-01-08 7:50 ` Alexander Viro
2001-01-08 11:46 ` Alan Cox
2001-01-08 11:50 ` Alexander Viro
2001-01-08 12:09 ` Alan Cox
2001-01-08 12:16 ` Alexander Viro
2001-01-08 12:26 ` Alan Cox
2001-01-08 13:17 ` Stefan Traby
2001-01-08 13:35 ` Alexander Viro
2001-01-08 14:00 ` Stefan Traby
2001-01-08 14:19 ` Alexander Viro
2001-01-08 14:40 ` Alan Cox
2001-01-08 14:52 ` Alexander Viro
2001-01-08 15:09 ` Alan Cox
2001-01-08 15:32 ` Alexander Viro
2001-01-08 15:55 ` Stefan Traby
2001-01-08 16:01 ` Alan Cox
2001-01-08 16:22 ` Stefan Traby
2001-01-08 17:10 ` Alan Cox
2001-01-08 18:05 ` Alexander Viro
2001-01-08 18:18 ` Stefan Traby
2001-01-08 18:22 ` Alexander Viro
2001-01-08 18:24 ` Stefan Traby
2001-01-08 18:33 ` Alexander Viro
2001-01-08 18:51 ` Stefan Traby
2001-01-08 18:54 ` Marc Lehmann
2001-01-08 19:07 ` Alexander Viro
2001-01-08 14:02 ` Alexander Viro
2001-01-08 15:37 ` Chris Mason
2001-01-08 15:47 ` Alexander Viro
2001-01-08 16:11 ` Chris Mason
2001-01-08 17:35 ` Alexander Viro
2001-01-08 17:50 ` Alan Cox
2001-01-08 19:07 ` Andreas Dilger [this message]
2001-01-08 20:12 ` Alexander Viro
2001-01-08 20:38 ` Andreas Dilger
2001-01-08 13:37 ` David Woodhouse
2001-01-08 21:34 Andries.Brouwer
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=200101081907.f08J7ev15806@webber.adilger.net \
--to=adilger@turbolinux.com \
--cc=alan@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mason@suse.com \
--cc=stefan@hello-penguin.com \
--cc=viro@math.psu.edu \
/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
Powered by JetHome