svn commit: r249144 - stable/9/sys/geom

Alexander Motin mav at FreeBSD.org
Fri Apr 5 10:22:23 UTC 2013


Author: mav
Date: Fri Apr  5 10:22:22 2013
New Revision: 249144
URL: http://svnweb.freebsd.org/changeset/base/249144

Log:
  MFC r226737 (by pjd):
  Allow upper layers to discover than BIO_DELETE and/or BIO_FLUSH is not
  supported by returning EOPNOTSUPP instead of 0 or ENODEV.

Modified:
  stable/9/sys/geom/geom_disk.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/geom/geom_disk.c
==============================================================================
--- stable/9/sys/geom/geom_disk.c	Fri Apr  5 10:13:44 2013	(r249143)
+++ stable/9/sys/geom/geom_disk.c	Fri Apr  5 10:22:22 2013	(r249144)
@@ -308,7 +308,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 */
@@ -397,8 +397,8 @@ g_disk_start(struct bio *bp)
 		g_trace(G_T_BIO, "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) {


More information about the svn-src-stable-9 mailing list