Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jun 2013 17:57:43 +0100
From:      Chris Rees <crees@bayofrum.net>
To:        Hiroki Sato <hrs@FreeBSD.org>
Cc:        swhetzel@gmail.com, freebsd-current@FreeBSD.org, freebsd-rc@FreeBSD.org, wblock@FreeBSD.org
Subject:   Re: RFC: swapon(8) vnode-backed md and gbde/geli encryption support
Message-ID:  <3F225AB1-8111-4841-97D7-0B525F9CC96C@bayofrum.net>
In-Reply-To: <20130627.170642.243849725172853011.hrs@allbsd.org>
References:  <20130623.035356.644417021040610458.hrs@allbsd.org> <CACdU%2Bf-OuPNckG%2BMJgfDopbT43xMrLy19LmEzLqgZ_XU9yYX7Q@mail.gmail.com> <20130624.032458.2116947740119973135.hrs@allbsd.org> <20130627.170642.243849725172853011.hrs@allbsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 27 Jun 2013, at 09:06, Hiroki Sato wrote:

> Hiroki Sato <hrs@freebsd.org> wrote
>  in <20130623.035356.644417021040610458.hrs@allbsd.org>:
> 
> hr> Hi,
> hr>
> hr>  I created a patchset to add support of automatic generation of
> hr>  vnode-backed md(4) devices and gbde/geli geom providers to swapon(8)
> hr>  via /etc/fstab.  We already have equivalent functionality by using
> hr>  rc.d scripts.  This simplifies rc.d scripts and fixes a race between
> hr>  mdconfig/gbde/geli and swapon/swapoff by using /etc/fstab.
> 
> A slightly revised patch is attached.  I will commit this today.
> 
> -- Hiroki
> - Add vnode-backed swap space specification support.  This is enabled when
>  device names "md" or "md[0-9]*" and a "file" option are specified in
>  /etc/fstab like this:
> 
>  md    none    swap    sw,file=/swap.bin       0       0
> 
> - Add GBDE/GELI encrypted swap space specification support, which
>  rc.d/encswap supported.  The /etc/fstab lines are like the following:
> 
>  /dev/ada1p1.bde       none    swap    sw      0       0
>  /dev/ada1p2.eli       none    swap    sw      0       0
> 
>  .eli devices accepts aalgo, ealgo, keylen, and sectorsize as options.
> 
>  swapctl(8) can understand an encrypted device in the command line
>  like this:
> 
>  # swapctl -a /dev/ada2p1.bde
> 
> - "-L" flag is added to support "late" option to defer swapon until
>  rc.d/mountlate runs.
> 
> - rc.d script change:
> 
>    rc.d/encswap -> removed
>    rc.d/addswap -> just display a warning message if  is defined.
>    rc.d/swap1 -> renamed to rc.d/swap
>    rc.d/swaplate -> newly added to support "late" option
> 
> These changes alleviate a race condition between device creation/removal
> and swapon/swapoff.
> 
> MFC after:      1 week

Looks fantastic-- better than hacking around in shell scripts I suppose :)

Chris


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F225AB1-8111-4841-97D7-0B525F9CC96C>