Re: Bug/patch for swapon system call

Paul Gortmaker (linux@rasty.ph.unimelb.edu.au)
Tue, 10 Mar 1998 18:58:17 +1100 (EST)


> goto bad_swap;
> - error = -EBUSY;
> - for (i = 0 ; i < nr_swapfiles ; i++) {
> - if (i == type)
> - continue;
> - if (p->swap_device == swap_info[i].swap_device)
> - goto bad_swap;
> - }
> } else if (!S_ISREG(swap_dentry->d_inode->i_mode))
> goto bad_swap;
> + error = -EBUSY;
> + for (i = 0 ; i < nr_swapfiles ; i++) {
> + if (i == type)
> + continue;
> + if (p->swap_device == swap_info[i].swap_device)
> + goto bad_swap;
> + }
> avail_map = (unsigned char *) get_free_page(GFP_USER);
> if (!avail_map) {
> printk("Unable to start swapping: out of memory :-)\n");

Of course this relocation is too restrictive, in that it blocks multiple
swapfiles on the same physical device. Thanks to Sylvain Pion for pointing
out the obvious to me. Anyway, sct has patches queued up to fix this bug,
so I won't append an updated patch here.

Paul.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu