Fwd: swapon and swapoff testcases on busybox

Riaz Rahaman rahaman.riaz at gmail.com
Tue Mar 13 07:44:37 UTC 2007


thanks.

I had already tried that...but now I found that the syscall swapon is giving
me the error.

BTW..the bb swaponoff file checks for the condition (st.st_blocks * 512 <
st.st_size) and gives a message if the swap file has holes...now do we
require this check in the busybox? can bb not call the swapon syscall from
swaponoff code..swapon syscall also seems to be doing the check.

Why is it that the block size has been hard code to 512 bytes? Any
particular reason for that?

I find that the linux kernel syscall swapon is the one givng me message that
my swap file has holes.

Riaz


On 3/12/07, Denis Vlasenko <vda.linux at googlemail.com> wrote:
>
> 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
>



-- 
Regards,
Riaz Ur Rahaman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20070313/98d929da/attachment-0001.htm 


More information about the busybox mailing list