Browse Source

dm: zero silently drop discards

Have the zero target silently drop a discard rather than fail the
request with -EOPNOTSUPP.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Mike Snitzer 15 years ago
parent
commit
f8facb61b5
1 changed files with 5 additions and 0 deletions
  1. 5 0
      drivers/md/dm-zero.c

+ 5 - 0
drivers/md/dm-zero.c

@@ -22,6 +22,11 @@ static int zero_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 		return -EINVAL;
 		return -EINVAL;
 	}
 	}
 
 
+	/*
+	 * Silently drop discards, avoiding -EOPNOTSUPP.
+	 */
+	ti->num_discard_requests = 1;
+
 	return 0;
 	return 0;
 }
 }