Re: [RFC PATCH 02/02] swapon: add "cluster-discard" support

From: Karel Zak
Date: Tue May 21 2013 - 06:26:59 EST

On Mon, May 20, 2013 at 09:02:43PM -0400, KOSAKI Motohiro wrote:
> > - if (fl_discard)
> > + if (fl_discard) {
> > flags |= SWAP_FLAG_DISCARD;
> > + if (fl_discard > 1)
> This is not enough, IMHO. When running this code on old kernel, swapon() return EINVAL.
> At that time, we should fall back swapon(0x10000).

Hmm.. currently we don't use any fallback for any swap flag (e.g.
0x10000) for compatibility with old kernels. Maybe it's better to
keep it simple and stupid and return an error message than introduce
any super-smart semantic to hide incompatible fstab configuration.


Karel Zak <kzak@xxxxxxxxxx>
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at