tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

genfs ignoring VOP_STRATEGY() buf's returned error

Dear folks,

i've noticed that if a FS returns an error in its VOP_STRATEGY() its bluntly
ignored by genfs resulting in a cp(1) action just continuing as if nothing
happend. With the accompanied patch the cp(1) action returns the error as it
should be. gop_write() calls genfs_do_io() but returns the error it gets from
genfs_do_io(). That error is allways zero if its done async so the cp(1)
action never gets the signal that something is wrong.

The patch fixes this by returning the error from the mbp buffer. If the
transaction can be done in one buffer this is correct, if it needs to be done
in multiple transactions then it will have the result till now as a

OK to commit? It is not altering the semantics.

With regards,

Index: genfs_io.c
RCS file: /cvsroot/src/sys/miscfs/genfs/genfs_io.c,v
retrieving revision 1.19
diff -u -p -r1.19 genfs_io.c
--- genfs_io.c  23 Feb 2009 21:27:51 -0000      1.19
+++ genfs_io.c  26 Mar 2009 17:04:51 -0000
@@ -1379,8 +1379,8 @@ genfs_do_io(struct vnode *vp, off_t off,
        nestiobuf_done(mbp, skipbytes, error);
        if (async) {
-               UVMHIST_LOG(ubchist, "returning 0 (async)", 0,0,0,0);
-               return (0);
+               UVMHIST_LOG(ubchist, "returning mbp->b_error (async)",
+               return mbp->b_error;
        UVMHIST_LOG(ubchist, "waiting for mbp %p", mbp,0,0,0);
        error = biowait(mbp);

Attachment: pgp2mPEc9wQdJ.pgp
Description: PGP signature

Home | Main Index | Thread Index | Old Index