OpenSolaris

Discussions Communities Projects Download Source Browser

Home » OpenSolaris Forums » zfs » code

Thread: ztest failing in ztest_vdev_attach_detach()

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 5 - Last Post: Jun 9, 2006 1:23 PM by: eschrock
Guest
ztest failing in ztest_vdev_attach_detach()
Posted: Jun 9, 2006 10:36 AM

  Click to reply to this thread Reply

[No Body]

Ricardo Correia
zfs-opensolaris@wizy...
Re: ztest failing in ztest_vdev_attach_detach()
Posted: Jun 9, 2006 10:36 AM   in response to: Guest

  Click to reply to this thread Reply

Ok, I'm glad to know my analysis was correct (I wasn't sure about it, though).

This means that the ztest port to Linux now doesn't have any known bugs ;)

Thank you for the fast response.

On Friday 09 June 2006 18:26, you wrote:
> This happens if you have:
>
> replacing
> foo
> bar
>
> And you try to replace 'foo' with 'bar. Sure enough, the old code used
> to do:
>
> if (parent is replacing)
> return ENOTSUP
> if (initialize new vdev failed)
> return failure (EBUSY)
>
> Now it switched the order:
>
> if (initialize new vdev failed)
> return failure (EBUSY)
> if (parent is replacing)
> return ENOTSUP
>
> Both cases are correct, its just a matter of which error condition gets
> triggered first. You cannot trigger this through the CLI (since it
> refuses to issue the ioctl because said disk is actively in use). I'll
> think some more about it, but most likely the correct fix is the one
> below.
>
> - Eric
>
> On Fri, Jun 09, 2006 at 10:12:51AM -0700, Eric Schrock wrote:
> > Yes, I'm seeing this unexpectedly fail with EBUSY (errno 16) instead of
> > ENOTSUP. This was definitely caused by the hot spare work, and it's my
> > fault for not running ztest more rigorously. I'll file a bug and take a
> > look. For now, you can change (in ztest.c):
> >
> > if (error == EOVERFLOW)
> > expected_error = error;
> >
> > To:
> >
> > if (error == EOVERFLOW || error == EBUSY)
> > expected_error = error;
> >
> > I've been able to run this way for 10 minutes, with the 'rarely ->
> > always' change.
> >
> > Sorry about that,
> >
> > - Eric
>
> --
> Eric Schrock, Solaris Kernel Development
> http://blogs.sun.com/eschrock
_______________________________________________
zfs-code mailing list
zfs-code at opensolaris dot org
http://opensolaris.org/mailman/listinfo/zfs-code



eschrock

Posts: 799
From: Menlo Park, CA

Registered: 3/9/05
Re: ztest failing in ztest_vdev_attach_detach()
Posted: Jun 9, 2006 10:50 AM   in response to: Ricardo Correia

  Click to reply to this thread Reply

On Fri, Jun 09, 2006 at 06:36:23PM +0100, Ricardo Correia wrote:
> Ok, I'm glad to know my analysis was correct (I wasn't sure about it, though).
>
> This means that the ztest port to Linux now doesn't have any known bugs ;)
>
> Thank you for the fast response.

Sweet! Let us know if you had to make any changes to non-zfs_context
code, and we can integrate the changes upstream to make future
maintenance/other ports easier. FYI, the fix I'll putback is slightly
different from what I mentioned previously:

------- usr/src/cmd/ztest/ztest.c -------

Index: usr/src/cmd/ztest/ztest.c
--- /ws/onnv-clone/usr/src/cmd/ztest/ztest.c Fri Jun 2 23:04:35 2006
+++ /export/eschrock/on-fixes/usr/src/cmd/ztest/ztest.c Fri Jun 9
10:46:35 2006
@@ -934,16 +934,16 @@
*
* If newvd is already part of the pool, it should fail with
* EBUSY.
*
* If newvd is too small, it should fail with EOVERFLOW.
*/
- if (pvd->vdev_ops != &vdev_mirror_ops &&
+ if (newvd != NULL)
+ expected_error = EBUSY;
+ else if (pvd->vdev_ops != &vdev_mirror_ops &&
pvd->vdev_ops != &vdev_root_ops &&
(!replacing || pvd->vdev_ops == &vdev_replacing_ops))
expected_error = ENOTSUP;
- else if (newvd != NULL)
- expected_error = EBUSY;
else if (newsize < oldsize)
expected_error = EOVERFLOW;
else if (ashift > oldvd->vdev_top->vdev_ashift)
expected_error = EDOM;
else


We already had the check for EBUSY, it just needed to be moved ahead of
ENOTSUP just like the associated code.

- Eric

--
Eric Schrock, Solaris Kernel Development http://blogs.sun.com/eschrock
_______________________________________________
zfs-code mailing list
zfs-code at opensolaris dot org
http://opensolaris.org/mailman/listinfo/zfs-code



Ricardo Correia
zfs-opensolaris@wizy...
Re: ztest failing in ztest_vdev_attach_detach()
Posted: Jun 9, 2006 11:48 AM   in response to: eschrock

  Click to reply to this thread Reply

Ok, the changes are available here: http://www.wizy.org/files/zfs-linux.patch

A few notes:

1) The patch includes the header Solaris/Linux differences. I'm not sure
what's relevant, if anything. I have included some Solaris-specific macros
and typedefs in sol_compat.h, so you will see some #includes removed.

By the way, I'm not exactly a C or UNIX expert (not even close), so if there
are any glaring errors in the #includes, please let me know :p

2) I don't know if I got the necessary casts correctly. I had to do it to
eliminate gcc warnings, I don't know how it'll work with the Sun Studio
compiler. I have tested them with gcc-3.4.5 in both x86 and x86-64 modes.

3) gcc spits a warning in this code: 'struct foo bar = { 0 }'.. I had to
change all such code to 'struct foo bar = {}'. The {0} syntax is correct
standard C, however.

4) The directory structure is not the same as in the OpenSolaris sources,
sorry about that.

On Friday 09 June 2006 18:50, Eric Schrock wrote:
> Sweet! Let us know if you had to make any changes to non-zfs_context
> code, and we can integrate the changes upstream to make future
> maintenance/other ports easier. FYI, the fix I'll putback is slightly
> ...
_______________________________________________
zfs-code mailing list
zfs-code at opensolaris dot org
http://opensolaris.org/mailman/listinfo/zfs-code



marks

Posts: 272
From: US

Registered: 3/9/05
Re: ztest failing in ztest_vdev_attach_detach()
Posted: Jun 9, 2006 12:15 PM   in response to: Ricardo Correia

  Click to reply to this thread Reply

Ricardo Correia wrote:
> Ok, the changes are available here: http://www.wizy.org/files/zfs-linux.patch
>
> A few notes:
>
> 1) The patch includes the header Solaris/Linux differences. I'm not sure
> what's relevant, if anything. I have included some Solaris-specific macros
> and typedefs in sol_compat.h, so you will see some #includes removed.
>
> By the way, I'm not exactly a C or UNIX expert (not even close), so if there
> are any glaring errors in the #includes, please let me know :p
>
> 2) I don't know if I got the necessary casts correctly. I had to do it to
> eliminate gcc warnings, I don't know how it'll work with the Sun Studio
> compiler. I have tested them with gcc-3.4.5 in both x86 and x86-64 modes.
>
> 3) gcc spits a warning in this code: 'struct foo bar = { 0 }'.. I had to
> change all such code to 'struct foo bar = {}'. The {0} syntax is correct
> standard C, however.

We are compiling this will both the Sun Compilers and gcc 3.4.3
We use a tool "cw" compiler wrapper to translate Sun Compiler options
into gcc options.

http://cvs.opensolaris.org/source/xref/on/usr/src/tools/cw/cw.c

_______________________________________________
zfs-code mailing list
zfs-code at opensolaris dot org
http://opensolaris.org/mailman/listinfo/zfs-code



eschrock

Posts: 799
From: Menlo Park, CA

Registered: 3/9/05
Re: ztest failing in ztest_vdev_attach_detach()
Posted: Jun 9, 2006 1:23 PM   in response to: marks

  Click to reply to this thread Reply

On Fri, Jun 09, 2006 at 01:15:23PM -0600, Mark Shellenbaum wrote:
>
> We are compiling this will both the Sun Compilers and gcc 3.4.3
> We use a tool "cw" compiler wrapper to translate Sun Compiler options
> into gcc options.
>

In particular, it looks like we're using the folowing options:

-Wall
-Wno-unknown-pragmas
-Wno-missing-braces
-Wno-sign-compare
-Wno-parentheses
-Wno-uninitialized
-Wno-implicit-function-declaration
-Wno-unused
-Wno-trigraphs
-Wno-char-subscripts
-Wno-switch

As well as the c99 flag, which gets turned into '-std=gnu99' on gcc.

- Eric

--
Eric Schrock, Solaris Kernel Development http://blogs.sun.com/eschrock
_______________________________________________
zfs-code mailing list
zfs-code at opensolaris dot org
http://opensolaris.org/mailman/listinfo/zfs-code






Terms of Use | Privacy | Trademarks | Copyright Policy | Site Guidelines
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Use.
Copyright © 1995-2005 Sun Microsystems, Inc.