bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: linux-swap code


From: Andrew Clausen
Subject: Re: linux-swap code
Date: Tue, 26 Mar 2002 16:34:48 +1100
User-agent: Mutt/1.3.17i

On Mon, Mar 25, 2002 at 04:01:54PM +0000, Richard Hirst wrote:
> @@ -383,6 +379,7 @@
>       if (!ped_geometry_read (fs->geom, fs_info->header, 0, 2))
>               return 0;
>       if (!rewrite) {
> +             /* Creating a new swapspace */
>  /* not many people use 2.0 nowadays.  If they are, then there's no harm 
> done...
>   * they'll just get a bit confused when they can't swap on...
>   */
> @@ -405,8 +402,11 @@
>                                               - sizeof (SwapNewHeader)) / 4;
>               memcpy (fs_info->sig, "SWAPSPACE2", 10);
>       }
> -     if (!swap_check_pages (fs))
> -             return 0;
> +     else {
> +             /* Checking an existing swapspace */
> +             if (!swap_check_pages (fs))
> +                     return 0;
> +     }
>       return ped_geometry_write (fs->geom, fs_info->header, 0,
>                                  fs_info->page_sectors);
>  }

This won't fix your complaint.  Resizing will also have rewrite == 1.
The best solution is probably to separate writing the header and
writing the bad page lists.  (i.e. make swap_check_pages() write
out the list, and let the caller call it as they wish)

The rest of the patch looks sane :)

Thanks,
Andrew




reply via email to

[Prev in Thread] Current Thread [Next in Thread]