[torqueusers] -l file=xxx parameter limited to 2Gb-1 max on Linux

Marcin Mogielnicki mar_mog at o2.pl
Thu Feb 3 08:59:25 MST 2005


There is one more thing I noticed. Every time a job chosen to start by 
mom is fails, if file parameter is greater or equal to two gigabytes. I 
think is is another hardcoded example of infamous file size limit. It 
fails exactly here:

halo g # grep -B 7 RLIMIT_FSIZE torque-1.1.0p6/src/resmom/linux/mom_mach.c
         if (value > INT_MAX)

         reslim.rlim_cur = reslim.rlim_max = value;

         if (setrlimit(RLIMIT_FSIZE,&reslim) < 0)

As you can see mom decides that setrlimit manages values not greater 
than INT_MAX. However it is not true:

halo g # grep -A 3 rlimit /usr/include/linux/resource.h
struct rlimit {
         unsigned long   rlim_cur;
         unsigned long   rlim_max;

I don't know when it was changed from int to ulong, but all my linux 
servers, even installed 2-3 years ago, devine RLIMIT_FSIZE values as 
ulong, so I think it should be changed in the way given below. It works 
for me for some time, users are able to request tens of gigabytes and 
they really are unable to write anything when they reach given limit.

	Marcin Mogielnicki

diff -r -u torque-1.1.0p6.orig/src/resmom/linux/mom_mach.c 
--- torque-1.1.0p6.orig/src/resmom/linux/mom_mach.c     2005-01-13 
03:02:01.000000000 +0100
+++ torque-1.1.0p6/src/resmom/linux/mom_mach.c  2005-02-02 
21:24:20.580571291 +0100
@@ -1094,7 +1094,8 @@

-        if (value > INT_MAX)
+        if (value > ULONG_MAX)

More information about the torqueusers mailing list