From: Alan Cox Date: Mon, 11 Mar 2002 05:57:35 +0000 (-0800) Subject: [PATCH] 2.5.6-pre3 Fix BSD accounting rlimit X-Git-Tag: v2.5.7-pre1~28^2~8 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=d82d83bbc7e3daaf6456487901a3597139b46731;p=history.git [PATCH] 2.5.6-pre3 Fix BSD accounting rlimit Fix rlimit on accounting file. --- diff --git a/kernel/acct.c b/kernel/acct.c index 99f44df17b49..a2787eb242a1 100644 --- a/kernel/acct.c +++ b/kernel/acct.c @@ -311,6 +311,7 @@ static void do_acct_process(long exitcode, struct file *file) struct acct ac; mm_segment_t fs; unsigned long vsize; + unsigned long flim; /* * First check to see if there is enough free_space to continue @@ -372,8 +373,14 @@ static void do_acct_process(long exitcode, struct file *file) */ fs = get_fs(); set_fs(KERNEL_DS); + /* + * Accounting records are not subject to resource limits. + */ + flim = current->rlim[RLIMIT_FSIZE].rlim_cur; + current->rlim[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY; file->f_op->write(file, (char *)&ac, sizeof(struct acct), &file->f_pos); + current->rlim[RLIMIT_FSIZE].rlim_cur = flim; set_fs(fs); }