Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Oct 2011 14:07:17 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r226737 - head/sys/geom
Message-ID:  <201110251407.p9PE7HHT099110@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110251407.p9PE7HHT099110>