On Thursday 27 March 2008 12:49, Jonathan Moore wrote: > The difference in messages is due to the ENABLE_DESKTOP define in swaponoff.c. > It's the actual status = swapon(device, 0) call just after this check, > that is causing the error repost.
Yes. Code tries to do the following. 1. Check for "holeness", if it seems that there are holes, warn user. 2. Execute swapon() nevertheless, report errors if any. There are four possible outcomes: 1. No errors. 2. "there are holes" warning, but swapon() worked - our "holeness" check is wrong. 3. no warning, but swapon() fails - most likely some problem not related to holes. 4. "there are holes" warning, and swapon() fails - most likely there are indeed holes. You have case 4. Since it is strange (dd should have created file w/o holes), I'd like to have more data. > BusyBox's swaponoff.c doesn't report a problem. > > I need to look deeper into swapon, and also possibly mkswap and dd too. Why don't you help bbox list to help you by letting us know what debug code *actually prints*? > You can obtain more data by adding this message: > > if (S_ISREG(st.st_mode)) > { > bb_error_msg("blocks %lld size %%lld", (unsigned long long)st.st_blocks, > (unsigned long long)st.st_size); > if (st.st_blocks * (off_t)512 < st.st_size) > bb_error_msg("warning: swap file has holes"); } -- vda _______________________________________________ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox