[linux 4.10] compile issue with potentially triggering the DMU_MAX_ACCESS assertion. #5530

Closed
philmmanjaro opened this Issue Dec 26, 2016 · 3 comments

Projects

None yet

3 participants

@philmmanjaro

System information

Type Version/Name
Distribution Name Manjaro Linux
Distribution Version 17.0-alpha1
Linux Kernel 4.10-rc1
Architecture i686 or x86_64
ZFS Version 0.6.5.8
SPL Version 0.6.5.8

Describe the problem you're observing

Compile error at search for I/O path used for discards

Describe how to reproduce the problem

Simply try to compile spl/zfs against the latest 4.10 kernel series.

Include any warning/errors/backtraces from the system logs

Error message:

/home/phil/dev/git/manjaro/repositories/extra/linux410-extramodules/spl_zfs/src/zfs-0.6.5.8/include/linux/blkdev_compat.h:390:2: Fehler: #error "Allowing the build will cause discard requests to become writes "
 #error "Allowing the build will cause discard requests to become writes "
  ^~~~~
/home/phil/dev/git/manjaro/repositories/extra/linux410-extramodules/spl_zfs/src/zfs-0.6.5.8/include/linux/blkdev_compat.h:391:2: Warnung: Anweisung ohne Effekt [-Wunused-value]
  "potentially triggering the DMU_MAX_ACCESS assertion. Please file "
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/phil/dev/git/manjaro/repositories/extra/linux410-extramodules/spl_zfs/src/zfs-0.6.5.8/include/linux/blkdev_compat.h:394:1: Fehler: expected »;« before »}« token
 }
 ^

Seems with linux 4.10-rc1 we don't find the discards:

checking whether REQ_OP_DISCARD is defined... no
checking whether REQ_OP_SECURE_ERASE is defined... no
checking whether REQ_OP_FLUSH is defined... no
checking whether bio->bi_opf is defined... yes
checking whether bio_end_io_t wants 1 arg... yes
checking whether BIO_RW_BARRIER is defined... no
checking whether BIO_RW_DISCARD is defined... no

This is the code-snippet creating the message:

/*
 * 4.8 - 4.x API,
 *   REQ_OP_DISCARD
 *
 * 2.6.36 - 4.7 API,
 *   REQ_DISCARD
 *
 * 2.6.28 - 2.6.35 API,
 *   BIO_RW_DISCARD
 *
 * In all cases the normal I/O path is used for discards.  The only
 * difference is how the kernel tags individual I/Os as discards.
 */
static inline boolean_t
bio_is_discard(struct bio *bio)
{
#if defined(HAVE_REQ_OP_DISCARD)
	return (bio_op(bio) == REQ_OP_DISCARD);
#elif defined(REQ_DISCARD)
	return (bio->bi_rw & REQ_DISCARD);
#elif defined(HAVE_BIO_RW_DISCARD)
	return (bio->bi_rw & (1 << BIO_RW_DISCARD));
#else
#error	"Allowing the build will cause discard requests to become writes "
	"potentially triggering the DMU_MAX_ACCESS assertion. Please file "
	"an issue report at: https://github.com/zfsonlinux/zfs/issues/new"
#endif
}
@dweeezil
Member

This will eventually be fixed by #5499 which should be finalized within a day or so. The handling of bio flags is in a bit of a state of flux in the upstream kernel at the moment.

@philmmanjaro

Sure, no rush on that. In some cases linux 4.10-rc1 don't boot at all. So there is still some weeks time to figure it out.

@gmelikov
Member

0.6.5.8 doesn't support this kernel, master branch does.

@gmelikov gmelikov closed this Jan 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment