* -tip: block, fuse: Fix build error in fs/fuse/dev.c
@ 2009-07-11 7:52 Ingo Molnar
2009-07-11 10:43 ` Jean Delvare
0 siblings, 1 reply; 4+ messages in thread
From: Ingo Molnar @ 2009-07-11 7:52 UTC (permalink / raw)
To: Linus Torvalds, Jens Axboe, Miklos Szeredi; +Cc: linux-kernel, Andrew Morton
Today's upstream tree build (x86, 64-bit, allnoconfig+CONFIG_FUSE)
failed with this build error:
fs/fuse/dev.c: In function ‘request_end’:
fs/fuse/dev.c:290: error: ‘BLK_RW_SYNC’ undeclared (first use in this function)
fs/fuse/dev.c:290: error: (Each undeclared identifier is reported only once
fs/fuse/dev.c:290: error: for each function it appears in.)
fs/fuse/dev.c:291: error: ‘BLK_RW_ASYNC’ undeclared (first use in this function)
Due to commit:
8aa7e84: Fix congestion_wait() sync/async vs read/write confusion
Creating a dependency of BDI callbacks on the BLK_RW_* constants,
while those constants are only defined if CONFIG_BLOCK is enabled.
Fix it the simplest way for now, by moving the definitions early
in blkdev.h (this cannot break anything), but the real fix would
be to split up blkdev.h into blkdev-types.h and blkdev-api.h and
make only the API definitions/declarations dependent on
CONFIG_BLOCK.
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
include/linux/blkdev.h | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 49ae079..a3cdc6d 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1,6 +1,14 @@
#ifndef _LINUX_BLKDEV_H
#define _LINUX_BLKDEV_H
+/*
+ * Definitions used on the !CONFIG_BLOCK case too:
+ */
+enum {
+ BLK_RW_ASYNC = 0,
+ BLK_RW_SYNC = 1,
+};
+
#ifdef CONFIG_BLOCK
#include <linux/sched.h>
@@ -70,11 +78,6 @@ enum rq_cmd_type_bits {
REQ_TYPE_ATA_PC,
};
-enum {
- BLK_RW_ASYNC = 0,
- BLK_RW_SYNC = 1,
-};
-
/*
* For request of type REQ_TYPE_LINUX_BLOCK, rq->cmd[0] is the opcode being
* sent down (similar to how REQ_TYPE_BLOCK_PC means that ->cmd[] holds a
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: -tip: block, fuse: Fix build error in fs/fuse/dev.c
2009-07-11 7:52 -tip: block, fuse: Fix build error in fs/fuse/dev.c Ingo Molnar
@ 2009-07-11 10:43 ` Jean Delvare
2009-07-11 11:10 ` Ingo Molnar
0 siblings, 1 reply; 4+ messages in thread
From: Jean Delvare @ 2009-07-11 10:43 UTC (permalink / raw)
To: Ingo Molnar
Cc: Linus Torvalds, Jens Axboe, Miklos Szeredi, linux-kernel,
Andrew Morton
Hi Ingo,
On Sat, 11 Jul 2009 09:52:01 +0200, Ingo Molnar wrote:
> Today's upstream tree build (x86, 64-bit, allnoconfig+CONFIG_FUSE)
> failed with this build error:
>
> fs/fuse/dev.c: In function ‘request_end’:
> fs/fuse/dev.c:290: error: ‘BLK_RW_SYNC’ undeclared (first use in this function)
> fs/fuse/dev.c:290: error: (Each undeclared identifier is reported only once
> fs/fuse/dev.c:290: error: for each function it appears in.)
> fs/fuse/dev.c:291: error: ‘BLK_RW_ASYNC’ undeclared (first use in this function)
>
> Due to commit:
>
> 8aa7e84: Fix congestion_wait() sync/async vs read/write confusion
>
> Creating a dependency of BDI callbacks on the BLK_RW_* constants,
> while those constants are only defined if CONFIG_BLOCK is enabled.
>
> Fix it the simplest way for now, by moving the definitions early
> in blkdev.h (this cannot break anything), but the real fix would
> be to split up blkdev.h into blkdev-types.h and blkdev-api.h and
> make only the API definitions/declarations dependent on
> CONFIG_BLOCK.
>
> Cc: Jens Axboe <jens.axboe@oracle.com>
> Cc: Miklos Szeredi <mszeredi@suse.cz>
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> ---
> include/linux/blkdev.h | 13 ++++++++-----
> 1 files changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index 49ae079..a3cdc6d 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -1,6 +1,14 @@
> #ifndef _LINUX_BLKDEV_H
> #define _LINUX_BLKDEV_H
>
> +/*
> + * Definitions used on the !CONFIG_BLOCK case too:
> + */
> +enum {
> + BLK_RW_ASYNC = 0,
> + BLK_RW_SYNC = 1,
> +};
> +
> #ifdef CONFIG_BLOCK
>
> #include <linux/sched.h>
> @@ -70,11 +78,6 @@ enum rq_cmd_type_bits {
> REQ_TYPE_ATA_PC,
> };
>
> -enum {
> - BLK_RW_ASYNC = 0,
> - BLK_RW_SYNC = 1,
> -};
> -
> /*
> * For request of type REQ_TYPE_LINUX_BLOCK, rq->cmd[0] is the opcode being
> * sent down (similar to how REQ_TYPE_BLOCK_PC means that ->cmd[] holds a
I have hit this build issue as well, but with CONFIG_BLOCK=y, so the
patch above does NOT fix it. The problem I see is that fs/fuse/dev.c
does not include <linux/blkdev.h> so it doesn't get the definitions
regardless of the configuration. Same problem in fs/nfs/write.c. The
patch below fixes it for me:
* * * * *
From: Jean Delvare <khali@linux-fr.org>
Subject: Fix BLK_RW_* build failures
Fix build failures caused by using BLK_RW_* constants without
including <linux/blkdev.h>.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Miklos Szeredi <mszeredi@suse.cz>
Cc: Ingo Molnar <mingo@elte.hu>
---
I have included pktcdvd and memcontrol in the patch, they don't build
for my config so I didn't see them fail, but I suspect they would, so
fix them too.
drivers/block/pktcdvd.c | 1 +
fs/fuse/dev.c | 1 +
fs/nfs/write.c | 1 +
mm/memcontrol.c | 1 +
4 files changed, 4 insertions(+)
--- linux-2.6.31-rc2.orig/drivers/block/pktcdvd.c 2009-07-11 12:32:46.000000000 +0200
+++ linux-2.6.31-rc2/drivers/block/pktcdvd.c 2009-07-11 12:33:02.000000000 +0200
@@ -62,6 +62,7 @@
#include <scsi/scsi.h>
#include <linux/debugfs.h>
#include <linux/device.h>
+#include <linux/blkdev.h>
#include <asm/uaccess.h>
--- linux-2.6.31-rc2.orig/fs/fuse/dev.c 2009-07-11 12:32:46.000000000 +0200
+++ linux-2.6.31-rc2/fs/fuse/dev.c 2009-07-11 12:33:02.000000000 +0200
@@ -16,6 +16,7 @@
#include <linux/pagemap.h>
#include <linux/file.h>
#include <linux/slab.h>
+#include <linux/blkdev.h>
MODULE_ALIAS_MISCDEV(FUSE_MINOR);
--- linux-2.6.31-rc2.orig/fs/nfs/write.c 2009-07-11 12:32:46.000000000 +0200
+++ linux-2.6.31-rc2/fs/nfs/write.c 2009-07-11 12:33:02.000000000 +0200
@@ -19,6 +19,7 @@
#include <linux/nfs_mount.h>
#include <linux/nfs_page.h>
#include <linux/backing-dev.h>
+#include <linux/blkdev.h>
#include <asm/uaccess.h>
--- linux-2.6.31-rc2.orig/mm/memcontrol.c 2009-07-11 12:32:46.000000000 +0200
+++ linux-2.6.31-rc2/mm/memcontrol.c 2009-07-11 12:33:02.000000000 +0200
@@ -37,6 +37,7 @@
#include <linux/vmalloc.h>
#include <linux/mm_inline.h>
#include <linux/page_cgroup.h>
+#include <linux/blkdev.h>
#include "internal.h"
#include <asm/uaccess.h>
--
Jean Delvare
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: -tip: block, fuse: Fix build error in fs/fuse/dev.c
2009-07-11 10:43 ` Jean Delvare
@ 2009-07-11 11:10 ` Ingo Molnar
2009-07-11 11:50 ` Jean Delvare
0 siblings, 1 reply; 4+ messages in thread
From: Ingo Molnar @ 2009-07-11 11:10 UTC (permalink / raw)
To: Jean Delvare
Cc: Linus Torvalds, Jens Axboe, Miklos Szeredi, linux-kernel,
Andrew Morton
* Jean Delvare <khali@linux-fr.org> wrote:
> Hi Ingo,
>
> On Sat, 11 Jul 2009 09:52:01 +0200, Ingo Molnar wrote:
> > Today's upstream tree build (x86, 64-bit, allnoconfig+CONFIG_FUSE)
> > failed with this build error:
> >
> > fs/fuse/dev.c: In function ‘request_end’:
> > fs/fuse/dev.c:290: error: ‘BLK_RW_SYNC’ undeclared (first use in this function)
> > fs/fuse/dev.c:290: error: (Each undeclared identifier is reported only once
> > fs/fuse/dev.c:290: error: for each function it appears in.)
> > fs/fuse/dev.c:291: error: ‘BLK_RW_ASYNC’ undeclared (first use in this function)
> >
> > Due to commit:
> >
> > 8aa7e84: Fix congestion_wait() sync/async vs read/write confusion
> >
> > Creating a dependency of BDI callbacks on the BLK_RW_* constants,
> > while those constants are only defined if CONFIG_BLOCK is enabled.
> >
> > Fix it the simplest way for now, by moving the definitions early
> > in blkdev.h (this cannot break anything), but the real fix would
> > be to split up blkdev.h into blkdev-types.h and blkdev-api.h and
> > make only the API definitions/declarations dependent on
> > CONFIG_BLOCK.
> >
> > Cc: Jens Axboe <jens.axboe@oracle.com>
> > Cc: Miklos Szeredi <mszeredi@suse.cz>
> > Signed-off-by: Ingo Molnar <mingo@elte.hu>
> > ---
> > include/linux/blkdev.h | 13 ++++++++-----
> > 1 files changed, 8 insertions(+), 5 deletions(-)
> >
> > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> > index 49ae079..a3cdc6d 100644
> > --- a/include/linux/blkdev.h
> > +++ b/include/linux/blkdev.h
> > @@ -1,6 +1,14 @@
> > #ifndef _LINUX_BLKDEV_H
> > #define _LINUX_BLKDEV_H
> >
> > +/*
> > + * Definitions used on the !CONFIG_BLOCK case too:
> > + */
> > +enum {
> > + BLK_RW_ASYNC = 0,
> > + BLK_RW_SYNC = 1,
> > +};
> > +
> > #ifdef CONFIG_BLOCK
> >
> > #include <linux/sched.h>
> > @@ -70,11 +78,6 @@ enum rq_cmd_type_bits {
> > REQ_TYPE_ATA_PC,
> > };
> >
> > -enum {
> > - BLK_RW_ASYNC = 0,
> > - BLK_RW_SYNC = 1,
> > -};
> > -
> > /*
> > * For request of type REQ_TYPE_LINUX_BLOCK, rq->cmd[0] is the opcode being
> > * sent down (similar to how REQ_TYPE_BLOCK_PC means that ->cmd[] holds a
>
> I have hit this build issue as well, but with CONFIG_BLOCK=y, so
> the patch above does NOT fix it. The problem I see is that
> fs/fuse/dev.c does not include <linux/blkdev.h> so it doesn't get
> the definitions regardless of the configuration. Same problem in
> fs/nfs/write.c. The patch below fixes it for me:
Yes, that's a different build bug already fixed in latest upstream:
097041e: fuse: Fix build error
Ingo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: -tip: block, fuse: Fix build error in fs/fuse/dev.c
2009-07-11 11:10 ` Ingo Molnar
@ 2009-07-11 11:50 ` Jean Delvare
0 siblings, 0 replies; 4+ messages in thread
From: Jean Delvare @ 2009-07-11 11:50 UTC (permalink / raw)
To: Ingo Molnar
Cc: Linus Torvalds, Jens Axboe, Miklos Szeredi, linux-kernel,
Andrew Morton
On Sat, 11 Jul 2009 13:10:40 +0200, Ingo Molnar wrote:
>
> * Jean Delvare <khali@linux-fr.org> wrote:
> > I have hit this build issue as well, but with CONFIG_BLOCK=y, so
> > the patch above does NOT fix it. The problem I see is that
> > fs/fuse/dev.c does not include <linux/blkdev.h> so it doesn't get
> > the definitions regardless of the configuration. Same problem in
> > fs/nfs/write.c. The patch below fixes it for me:
>
> Yes, that's a different build bug already fixed in latest upstream:
>
> 097041e: fuse: Fix build error
Ah, I had missed that one because it has not been snapshot yet. Thanks
for pointing it out.
--
Jean Delvare
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-07-11 11:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-11 7:52 -tip: block, fuse: Fix build error in fs/fuse/dev.c Ingo Molnar
2009-07-11 10:43 ` Jean Delvare
2009-07-11 11:10 ` Ingo Molnar
2009-07-11 11:50 ` Jean Delvare
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox