Subject: Re: letting userland issue FUA writes
To: Steven M. Bellovin <smb@cs.columbia.edu>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 03/14/2006 23:03:20
--/WwmFnJnmDyWGHa4
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Mar 14, 2006 at 11:41:53PM -0500, Steven M. Bellovin wrote:
> On Tue, 14 Mar 2006 18:35:46 -0800, Bill Studenmund
> <wrstuden@NetBSD.org> wrote:
>=20
> > I'm interested in adding infrastructure so that applications can issue=
=20
> > writes that have the FUA (Force Unit Access) bit set. SCSI CDBs handle=
=20
> > this, as do some RAID cards.
> >=20
> > The main question I have is what kind of user-level interfaces exist fo=
r=20
> > this? I certainly could cook up a new system call, but I would much rat=
her=20
> > use prior art. My simplistic attempt at googling for this failed. Does=
=20
> > anyone else have suggestions?
> >=20
> > Given the systemcall interface, driving it through the kernel isn't har=
d.=20
> > A flag here and a flag there, and it's set.
>=20
> Given that it pertains to a file descriptor, shouldn't it be an ioctl?

What I really want is to be able to issue some writes with FUA set and=20
some with FUA cleared.

If for instance you are implementing a SCSI device in software (say an=20
iSCSI target), you do not know before hand if you are going to get FUA-set=
=20
or FUA-cleared writes.

However it probably should be good to have a descriptor-level flag, so=20
that things like a database can just get FUA for all writes.

Such a thing wouldn't be hard, as all writes pile into dofilewrite() and=20
dofilewritev() now. So they, or vn_write(), could just set the flag if=20
requested.

Take care,

Bill

--/WwmFnJnmDyWGHa4
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD8DBQFEF7w4Wz+3JHUci9cRAncoAKCJSUY+3sm8lgILfJRD2k3/Ih3nWQCfTA/n
5lWw8L/HlW/NmYb0ua5yFtY=
=nH7/
-----END PGP SIGNATURE-----

--/WwmFnJnmDyWGHa4--