Re: setrlimit and RLIM_INFINITY causing fsck failure, 2.4.18

Andreas Dilger (adilger@clusterfs.com)
Tue, 19 Mar 2002 07:15:54 -0700


On Mar 19, 2002 17:45 -0000, Peter Hartley wrote:
> In particular, this means that an e2fsck 1.27 built against such a glibc
> will fail with SIGXFS every time on any block device bigger than 2Gbytes.
> This is because:
>
> * e2fsck calls setrlimit(RLIMIT_FSIZE, RLIM_INFINITY) in
> an attempt to unset the limit. RLIM_INFINITY here is
> 0xFFFFFFFF. This is IMO the Right Thing.

It is only the right thing if the original limit was not 0xFFFFFFFF.
Otherwise, it is just adding to the problem, because the problem only
happens when you try to SET the limit.

> Surely the only Right Things to do in the kernel are (a) invent a new
> setrlimit call that corrects the RLIM_INFINITY value, or (b) have the
> current setrlimit call correct the RLIM_INFINITY value unconditionally.

(c) rlimit should not apply to block devices.

There were patches for this floating around, and I thought they made it
into 2.4.18, but they did not.

I do agree that we should also fix "setrlimit" to do the 0x7FFFFFFF to
0xFFFFFFFF correction.

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 More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/