[parted-devel] Strange linux-swap name change
Jim Meyering
jim at meyering.net
Fri Jun 26 20:51:35 UTC 2009
Colin Watson wrote:
> This might be a bit more controversial than my last linux-swap patch.
> :-)
>
> I just noticed due to a comment from Otavio Salvador that linux-swap had
> its name changed to "linux-swap(new)" a while back. I know this was ages
> ago (January 2007!), but I'd like to suggest that this was poorly
> designed, for the following reasons:
>
> Firstly, "old" and "new" is never a good way to name anything. When a
> third format comes along, you either have to rename things or you have
> to cope with "new" not being current any more. I used to live in a place
> called "New Court" which was built in the early 19th century. :-) There
> are perfectly good version numbers for the swap formats, 0 and 1 - why
> not use them?
>
> Secondly, according to mkswap(8) swap v0 has not been supported since
> Linux 2.5.22, and swap v1 has been supported since 2.1.117. In other
> words, just about the entire Linux planet is using swap v1 now. It seems
> wrong to make them all type "(new)" as a sort of code for "the one that
> actually works".
>
> Thirdly, even if you want to call the current swap format something
> other than "linux-swap", it would be most convenient if "linux-swap"
> were supported for input. I suppose this means that people using
> libparted still have to cope with the new name on output (?), but even
> so it would be useful.
This is the only troubling detail, since
some tools already parse linux-swap(new), which
appears in the output of at least "parted /dev/... print"
new (this is a GPT partition table):
[incidentally, I noticed that "Name" is the wrong heading here]
Number Start End Size File system Name Flags
...
3 5369MB 14.0GB 8590MB linux-swap primary
old (this is an msdos one):
Number Start End Size Type File system Flags
1 32.3kB 2048MB 2048MB primary linux-swap(new)
I skimmed through these (tools that parse linux-swap[^(]):
http://www.google.com/codesearch?q=\%22linux-swap[^%22]
but don't see any compelling objection, since I'll bet most already
handle the case of "linux-swap" without the "(new)" suffix.
So, I'm inclined to give it a shot and apply this on master.
FWIW, I confirmed that it causes no trouble on next, too.
The only remaining piece (barring objections) would
be an addition for NEWS. Would you write that, summarizing
what you've written here?
Jim
More information about the parted-devel
mailing list