From: "Peter Hartley" <pdh@utter.chaos.org.uk>
To: "Alan Cox" <alan@lxorguk.ukuu.org.uk>
Cc: "Andreas Dilger" <adilger@clusterfs.com>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] Re: setrlimit and RLIM_INFINITY causing fsck failure, 2.4.18
Date: Wed, 20 Mar 2002 10:12:16 -0000 [thread overview]
Message-ID: <004a01c1cffa$807528e0$2701230a@electronic> (raw)
In-Reply-To: <E16nOb2-0008Pk-00@the-village.bc.nu>
[-- Attachment #1: Type: text/plain, Size: 322 bytes --]
AC wrote:
> Test it and see 8)
OK, did do. Patch attached. The occurrence in filemap.c was the one killing
fsck, but I went looking for other occurrences of SIGXFS and made sure they
did the right thing too.
This doesn't address any other wonkiness of rlimit, it just stops it
applying to block devices.
Peter
[-- Attachment #2: sigxfs-vs-blkdev.patch --]
[-- Type: application/octet-stream, Size: 1737 bytes --]
diff -u3 -r linux/fs/buffer.c linux.pdh/fs/buffer.c
--- linux/fs/buffer.c Mon Feb 25 19:38:08 2002
+++ linux.pdh/fs/buffer.c Tue Mar 19 19:23:43 2002
@@ -1834,7 +1834,7 @@
err = -EFBIG;
limit = current->rlim[RLIMIT_FSIZE].rlim_cur;
- if (limit != RLIM_INFINITY && size > (loff_t)limit) {
+ if (limit != RLIM_INFINITY && size > (loff_t)limit && !S_ISBLK(inode->i_mode)) {
send_sig(SIGXFSZ, current, 0);
goto out;
}
diff -u3 -r linux/mm/filemap.c linux.pdh/mm/filemap.c
--- linux/mm/filemap.c Mon Feb 25 19:38:13 2002
+++ linux.pdh/mm/filemap.c Tue Mar 19 19:21:17 2002
@@ -2885,8 +2885,8 @@
* Check whether we've reached the file size limit.
*/
err = -EFBIG;
-
- if (limit != RLIM_INFINITY) {
+
+ if (limit != RLIM_INFINITY && !S_ISBLK(inode->i_mode)) {
if (pos >= limit) {
send_sig(SIGXFSZ, current, 0);
goto out;
diff -u3 -r linux/mm/memory.c linux.pdh/mm/memory.c
--- linux/mm/memory.c Mon Feb 25 19:38:13 2002
+++ linux.pdh/mm/memory.c Tue Mar 19 19:22:45 2002
@@ -1059,7 +1059,7 @@
do_expand:
limit = current->rlim[RLIMIT_FSIZE].rlim_cur;
- if (limit != RLIM_INFINITY && offset > limit)
+ if (limit != RLIM_INFINITY && offset > limit && !S_ISBLK(inode->i_mode))
goto out_sig;
if (offset > inode->i_sb->s_maxbytes)
goto out;
diff -u3 -r linux/mm/shmem.c linux.pdh/mm/shmem.c
--- linux/mm/shmem.c Mon Feb 25 19:38:14 2002
+++ linux.pdh/mm/shmem.c Tue Mar 19 19:23:17 2002
@@ -780,7 +780,7 @@
* Check whether we've reached the file size limit.
*/
err = -EFBIG;
- if (limit != RLIM_INFINITY) {
+ if (limit != RLIM_INFINITY && !S_ISBLK(inode->i_mode)) {
if (pos >= limit) {
send_sig(SIGXFSZ, current, 0);
goto out;
next prev parent reply other threads:[~2002-03-20 10:36 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 ` Peter Hartley [this message]
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
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='004a01c1cffa$807528e0$2701230a@electronic' \
--to=pdh@utter.chaos.org.uk \
--cc=adilger@clusterfs.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
/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