Fwd: swapon and swapoff testcases on busybox

Denis Vlasenko vda.linux at googlemail.com
Mon Mar 12 15:35:05 UTC 2007


On Monday 12 March 2007 12:07, Riaz Rahaman wrote:
> In case this might be related to swapon functionality of busybox
> 
> ---------- Forwarded message ----------
> From: Riaz Rahaman <rahaman.riaz at gmail.com>
> Date: Mar 12, 2007 4:36 PM
> Subject: swapon and swapoff testcases on busybox
> To: ltp-list at lists.sourceforge.net
> 
> Hi,
> 
> I am trying to run swapon and swapoff function on busybox....
> 
> I get this error
> 
> swapon: swapfile01 has holes
> swapon: ./swapfile01: Invalid argument
> 
> when trying to enable swap file, did anyone face similar problem?
> 
> I ever tried by creating a swapfile on a different machine and got it to
> this machine and ran the testcase....but got the same error...not sure if
> there is a problem with the swapon function of the busybox or something
> passed wrongly in the testcase.

Much to my surprise, bbox does check for holes:

        /* test for holes */
        if (S_ISREG(st.st_mode))
                if (st.st_blocks * 512 < st.st_size)
                        bb_error_msg_and_die("swap file has holes");

Try removing this if() entirely.
--
vda



More information about the busybox mailing list