On Thu, 18 Mar 1999, Philip Blundell wrote:

> You could try instrumenting the kernel to see what's going on.  In other 
> words, add some strategic printk calls in sys_swapon (it's in 
> mm/swapfile.c).  The check it does is pretty straightforward.

Okay, problem found, sort of.  The exact code failing (as evidenced
by the console messages) is in mm/page_io.c, in rw_swap_page_base():

    struct inode *swapf = p->swap_file->d_inode;
    int i;
    if (swapf->i_op->bmap == NULL
      && swapf->i_op->smap != NULL){
      /*
        It sounds like ll_rw_swap_file defined
        its operation size (sector size) based on
        PAGE_SIZE and the number of blocks to read.
        So using bmap or smap should work even if
        smap will require more blocks.
      */
      int j;
      unsigned int block = offset << 3;

      for (i=0, j=0; j< PAGE_SIZE ; i++, j += 512){
        if (!(zones[i] = swapf->i_op->smap(swapf,block++))) {
          printk("rw_swap_page: bad swap file\n");
          return;
      }
      block_size = 512;

This test is only run for swap files, not swap devices, and is some
way down the chain from a call in swapfile.c to page in the first
page in the swap file (containing the magic).

I'm investigating more fully.  Anyone care to tell me what this
bit is meant to do (before I figure it out sooner or later)?

-- 
Chris <[EMAIL PROTECTED]>                         ( http://www.fluff.org/chris )

unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]

Reply via email to