Author: pjd
Date: Tue Oct 25 14:07:17 2011
New Revision: 226737
URL: http://svn.freebsd.org/changeset/base/226737

Log:
  Allow upper layers to discover than BIO_DELETE and/or BIO_FLUSH is not
  supported by returning EOPNOTSUPP instead of 0 or ENODEV.
  
  MFC after:    3 days

Modified:
  head/sys/geom/geom_disk.c

Modified: head/sys/geom/geom_disk.c
==============================================================================
--- head/sys/geom/geom_disk.c   Tue Oct 25 14:05:39 2011        (r226736)
+++ head/sys/geom/geom_disk.c   Tue Oct 25 14:07:17 2011        (r226737)
@@ -305,7 +305,7 @@ g_disk_start(struct bio *bp)
        switch(bp->bio_cmd) {
        case BIO_DELETE:
                if (!(dp->d_flags & DISKFLAG_CANDELETE)) {
-                       error = 0;
+                       error = EOPNOTSUPP;
                        break;
                }
                /* fall-through */
@@ -394,8 +394,8 @@ g_disk_start(struct bio *bp)
                g_trace(G_T_TOPOLOGY, "g_disk_flushcache(%s)",
                    bp->bio_to->name);
                if (!(dp->d_flags & DISKFLAG_CANFLUSHCACHE)) {
-                       g_io_deliver(bp, ENODEV);
-                       return;
+                       error = EOPNOTSUPP;
+                       break;
                }
                bp2 = g_clone_bio(bp);
                if (bp2 == NULL) {
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to