All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] Make check_mount_writes() test appropriate device types
@ 2017-03-13 18:14 kusumi.tomohiro
  2017-03-13 18:14 ` [PATCH 2/7] HOWTO: Add note/exception on allow_mounted_write= kusumi.tomohiro
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: kusumi.tomohiro @ 2017-03-13 18:14 UTC (permalink / raw)
  To: axboe, fio; +Cc: Tomohiro Kusumi

From: Tomohiro Kusumi <tkusumi@tuxera.com>

There are platforms that use chrdev (instead of blkdev) for block
devices, thus check_mount_writes() needs to test an appropriate file
type(s) for potential mounted devices.

fio has had a macro FIO_HAVE_CHARDEV_SIZE basically for those using
chrdev for block devices, and this macro can be used here as well.

In FreeBSD and several others, blkdev is no longer used as a file type,
so it's safe to only test FIO_TYPE_CHAR if FIO_HAVE_CHARDEV_SIZE is
defined, but this commit leaves FIO_TYPE_BLOCK test since some
platforms may have/use both for block devices (not sure if exist).

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
---
 backend.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/backend.c b/backend.c
index 2e8a994..b61de7c 100644
--- a/backend.c
+++ b/backend.c
@@ -2056,8 +2056,16 @@ static bool check_mount_writes(struct thread_data *td)
 	if (!td_write(td) || td->o.allow_mounted_write)
 		return false;
 
+	/*
+	 * If FIO_HAVE_CHARDEV_SIZE is defined, it's likely that chrdevs
+	 * are mkfs'd and mounted.
+	 */
 	for_each_file(td, f, i) {
+#ifdef FIO_HAVE_CHARDEV_SIZE
+		if (f->filetype != FIO_TYPE_BLOCK && f->filetype != FIO_TYPE_CHAR)
+#else
 		if (f->filetype != FIO_TYPE_BLOCK)
+#endif
 			continue;
 		if (device_is_mounted(f->file_name))
 			goto mounted;
-- 
2.9.3



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-03-13 18:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-13 18:14 [PATCH 1/7] Make check_mount_writes() test appropriate device types kusumi.tomohiro
2017-03-13 18:14 ` [PATCH 2/7] HOWTO: Add note/exception on allow_mounted_write= kusumi.tomohiro
2017-03-13 18:26   ` Jens Axboe
2017-03-13 18:14 ` [PATCH 3/7] Minor fixup for page cache invalidation debug prints kusumi.tomohiro
2017-03-13 18:15 ` [PATCH 4/7] Use ENOTSUP if OS doesn't support blkdev page cache invalidation kusumi.tomohiro
2017-03-13 18:15 ` [PATCH 5/7] Fix errval variable to be positive errno value kusumi.tomohiro
2017-03-13 18:15 ` [PATCH 6/7] manpage: Add URL links to HOWTO/README kusumi.tomohiro
2017-03-13 18:15 ` [PATCH 7/7] Apply outbox patch from FreeBSD ports kusumi.tomohiro
2017-03-13 18:26   ` Jens Axboe
2017-03-13 18:27 ` [PATCH 1/7] Make check_mount_writes() test appropriate device types Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.