Subject: Re: Proposal: File system suspension - prerequisite for snapshots
To: Juergen Hannken-Illjes <hannken@eis.cs.tu-bs.de>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 08/14/2003 17:15:31
On Thu, 14 Aug 2003, Juergen Hannken-Illjes wrote:

> On Wed, Aug 13, 2003 at 02:42:33PM -0700, Bill Studenmund wrote:
> > i.e. it will be:
> >
> > vn_start_write(..., V_NOWAIT) == error
> > vn_start_write(..., V_XSLEEP | PCATCH) == no error
> > vn_start_write(..., V_NOWAIT) == no error I assume <- second success call
>
> I still don't see the problem:
>
> 	Case 1: Filesystem is not suspended
>
> 	vn_start_write(..., V_NOWAIT) succeeds, the gate is open, we do the
> 	write and close the gate (vn_finished_write())
>
> 	Case 2: Filesystem is suspended
>
> 	vn_start_write(..., V_NOWAIT) fails, gate is still closed.
> 	vn_start_write(..., V_XSLEEP | PCATCH) sleeps until the filesystem is
> 	resumed. The gate is still closed.  The complete system call is
> 	restarted (goto restart)
>
> The do_the_write_operation is only reached if the filesystem is not suspended.
>
> The flags to vn_start_write are:
>
> 	V_NOWAIT	Don't block, return EWOULDBLOCK
> 	V_XSLEEP	Block, but don't open the gate

Oh. Well, if you define the flags that way, that's what'll happen. However
I find that syntax very confusing. My typical assumption would be that if
I call vn_start_write() and it succeeds, then I can do the write ("the
gate is open." The non-gate-opening syntax is very weird.

Take care,

Bill