From: "Peter Hartley" <pdh@utter.chaos.org.uk>
To: "Theodore Tso" <tytso@mit.edu>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: setrlimit and RLIM_INFINITY causing fsck failure, 2.4.18
Date: Wed, 20 Mar 2002 10:09:10 -0000 [thread overview]
Message-ID: <004901c1cffa$80567d50$2701230a@electronic> (raw)
In-Reply-To: <006701c1cf6d$d9701230$2701230a@electronic> <20020319191018.A23000@thunk.org>
Theodore Tso wrote:
> On Tue, Mar 19, 2002 at 05:45:24PM -0000, Peter Hartley wrote:
> > * glibc knows nothing about the new unsigned limits, because
> > it's compiled against 2.2 headers. So it clips the limit
> > value to 0x7FFFFFFF to "correct" it before calling the
> > setrlimit syscall. This is IMO still the Right Thing,
> > because it's trying to call the old syscall as if to run
> > a new program on a 2.2 kernel.
>
> Unfortunately, all of my testing was done under systems where the
> glibc was already compiled under 2.4 headers, so I didn't realize that
> glibc would try to be "helpful" and correct the limit used by rlimit.
> (In other words, the e2fsprogs workaround was only worked in the case
> where other programs were losing because they were using the 2.2
> kernel ABI, but the libc was using the 2.4 kernel ABI. Sigh.)
>
> So obviously, the way I need to fix e2fsprogs is to fork a child
> process, check to see whether or not I can safely call setrlimit, and
> if not, exit without trying to set it. :-( This is a really dirty
> hack, but I don't see any other way fixing user-land programs that are
> trying to work around this ABI mess.
I don't think you can tell whether it's safe to call setrlimit (unless you
mean having e2fsck call the *syscall* directly, which is icky). The
getrlimit in a 2.2-headered glibc returns 0x7FFFFFFF whether the kernel's
idea of the value is 0x7FFFFFFF or 0xFFFFFFFF. I still like Andreas Dilger's
idea that you only set the limit if it's not already RLIM_INFINITY as
returned by glibc.
If PAM, or something else, has already set the 0x7FFFFFFF value, there
appears to be no way of setting the 0xFFFFFFFF value via a 2.2-headered
glibc :-( and you'd need to go for the syscall :-((
Peter
prev parent reply other threads:[~2002-03-20 10:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-19 17:45 setrlimit and RLIM_INFINITY causing fsck failure, 2.4.18 Peter Hartley
2002-03-19 14:15 ` Andreas Dilger
2002-03-19 18:20 ` Peter Hartley
2002-03-19 18:44 ` Alan Cox
2002-03-20 10:12 ` [PATCH] " Peter Hartley
2002-03-19 18:30 ` Alan Cox
2002-03-19 18:17 ` Alan Cox
2002-03-20 0:10 ` Theodore Tso
2002-03-20 2:04 ` Benjamin LaHaise
2002-03-20 10:09 ` Peter Hartley [this message]
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='004901c1cffa$80567d50$2701230a@electronic' \
--to=pdh@utter.chaos.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.