FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 12-31-2011, 03:46 AM
 
Default aufs: Do not refer to AUFS_NAME in pr_fmt

Hello Ben,

Ben Hutchings:
> AUFS_NAME is only defined in aufs_type.h but pr_fmt may be used in
> headers included before aufs_type.h.

Thanx for bug reporting and a patch.

I don't think the "current" macro will be a problem, but I want you to
test this patch since I don't have m68k environment.
It introduces a new separated file include/linux/aufs_name.h.
If you (any of you) think this new file is not a good idea, please let
me know.


J. R. Okajima

diff --git a/Documentation/filesystems/aufs/README b/Documentation/filesystems/aufs/README
index 420faeb..058f95e 100644
--- a/Documentation/filesystems/aufs/README
+++ b/Documentation/filesystems/aufs/README
@@ -213,7 +213,7 @@ If you don't like aufs2-standalone.patch, then try aufs2-2.6 tree.
path on the branch fs.
- apply ./aufs2-standalone.patch too, if you have a plan to set
CONFIG_AUFS_FS=m. otherwise you don't need ./aufs2-standalone.patch.
-- copy ./{Documentation,fs,include/linux/aufs_type.h} files to your
+- copy ./{Documentation,fs,include/linux/*.h} files to your
kernel source tree. Never copy ./include/linux/Kbuild.
- enable CONFIG_EXPERIMENTAL and CONFIG_AUFS_FS, you can select either
=m or =y.
@@ -240,12 +240,12 @@ If you don't like aufs2-standalone.patch, then try aufs2-2.6 tree.
+ run "make install" to install the aufs module, or copy the built
./aufs.ko to /lib/modules/... and run depmod -a (or reboot simply).
+ run "make headers_install" to install the aufs header file (you can
- specify DESTDIR), or copty ./usr/include/linux/aufs_type.h to
+ specify DESTDIR), or copty ./usr/include/linux/*.h to
/usr/include/linux or wherever you like.
- no need to apply aufs2-kbuild.patch, nor copying source files to your
kernel source tree.

-Note: The haeder file aufs_type.h is necessary to build aufs2-util
+Note: The aufs haeder files under include/linux are necessary to build aufs2-util
as well as "make headers_install" in the kernel source tree.
headers_install is subject to be forgotten, but it is essentially
necessary, not only for building aufs2-util.
@@ -255,7 +255,7 @@ Note: The haeder file aufs_type.h is necessary to build aufs2-util
And then,
- read README in aufs2-util, build and install it.
- note that your distribution may contain an obsoleted version of
- aufs_type.h in /usr/include/linux or something. When you build aufs
+ aufs header files in /usr/include/linux or something. When you build aufs
utilities, make sure that your compiler refers the correct aufs header
file which is built by "make headers_install."
- if you want to use readdir(3) in userspace or pathconf(3) wrapper,
diff --git a/fs/aufs/Makefile b/fs/aufs/Makefile
index 0a757f4..b63f12a 100644
--- a/fs/aufs/Makefile
+++ b/fs/aufs/Makefile
@@ -9,6 +9,7 @@ endif
# enable pr_debug
ccflags-y += -DDEBUG
# sparse doesn't allow spaces
+ccflags-y += -imacros linux/aufs_name.h
ccflags-y += -D'pr_fmt(fmt)=AUFS_NAME"40%s:%d:%s[%d]:40"fmt,__func__,__LINE__,current->comm,current->pid'

obj-$(CONFIG_AUFS_FS) += aufs.o
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 4268c75..60bd38d 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -34,6 +34,7 @@ header-y += atmppp.h
header-y += atmsap.h
header-y += atmsvc.h
header-y += atm_zatm.h
+header-y += aufs_name.h
header-y += aufs_type.h
header-y += auto_fs4.h
header-y += ax25.h
diff --git a/include/linux/aufs_name.h b/include/linux/aufs_name.h
new file mode 100644
index 0000000..838cc43
--- /dev/null
+++ b/include/linux/aufs_name.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2011 Junjiro R. Okajima
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __AUFS_NAME_H__
+#define __AUFS_NAME_H__
+
+/* fs/aufs/Makefile refers this macro */
+#define AUFS_NAME "aufs"
+
+#endif /* __AUFS_NAME_H__ */
diff --git a/include/linux/aufs_type.h b/include/linux/aufs_type.h
index ca4a6be..6f23223 100644
--- a/include/linux/aufs_type.h
+++ b/include/linux/aufs_type.h
@@ -28,6 +28,7 @@
#include <stdint.h>
#include <sys/types.h>
#endif
+#include <linux/aufs_name.h>

#define AUFS_VERSION "2.2-stdalone-35-lktr-YyyyMmDd"

@@ -58,7 +59,6 @@ typedef int16_t aufs_bindex_t;

/* ---------------------------------------------------------------------- */

-#define AUFS_NAME "aufs"
#define AUFS_FSTYPE AUFS_NAME

#define AUFS_ROOT_INO 2


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 9569.1325306817@jrobl">http://lists.debian.org/9569.1325306817@jrobl
 
Old 12-31-2011, 07:01 AM
Geert Uytterhoeven
 
Default aufs: Do not refer to AUFS_NAME in pr_fmt

On Sat, Dec 31, 2011 at 05:46, <sfjro@users.sourceforge.net> wrote:
> +/* fs/aufs/Makefile refers this macro */
> +#define AUFS_NAME * * * * * * *"aufs"

If the Makefile refers to the macro, perhaps the Makefile should
define it, and pass it with -D?

Gr{oetje,eeting}s,

* * * * * * * * * * * * Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
* * * * * * * * * * * * * ** ** -- Linus Torvalds


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAMuHMdXFrFqxjEBr5iG4s7naBRom6FzM6wPGi1f9HYVsv_c8d g@mail.gmail.com">http://lists.debian.org/CAMuHMdXFrFqxjEBr5iG4s7naBRom6FzM6wPGi1f9HYVsv_c8d g@mail.gmail.com
 
Old 12-31-2011, 03:31 PM
Thorsten Glaser
 
Default aufs: Do not refer to AUFS_NAME in pr_fmt

sfjro@users.sourceforge.net dixit:

>test this patch since I don't have m68k environment.

I can do that, but not too many patches at a time, since it takes
easily a whole day to compile it. (Also, my own hacking time is
limited atm.)

>It introduces a new separated file include/linux/aufs_name.h.

Isn’t that a bit overkill?

Geert Uytterhoeven dixit:

>On Sat, Dec 31, 2011 at 05:46, <sfjro@users.sourceforge.net> wrote:
>> +/* fs/aufs/Makefile refers this macro */
>> +#define AUFS_NAME * * * * * * *"aufs"
>
>If the Makefile refers to the macro, perhaps the Makefile should
>define it, and pass it with -D?

Indeed. I like Ben’s patch better. But if it must be a separate
file, please move the pr_fmt definition out of the Makefile and
into that file, too. Code doesn’t belong into a Makefile IMHO.

bye,
//mirabilos
--
FWIW, I'm quite impressed with mksh interactively. I thought it was much
*much* more bare bones. But it turns out it beats the living hell out of
ksh93 in that respect. I'd even consider it for my daily use if I hadn't
wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mksh


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: Pine.BSM.4.64L.1112311628570.14351@herc.mirbsd.org ">http://lists.debian.org/Pine.BSM.4.64L.1112311628570.14351@herc.mirbsd.org
 
Old 12-31-2011, 09:18 PM
Thorsten Glaser
 
Default aufs: Do not refer to AUFS_NAME in pr_fmt

Ben Hutchings dixit:

>-ccflags-y += -D'pr_fmt(fmt)=AUFS_NAME"40%s:%d:%s[%d]:40"fmt,__func__,__LINE__,current->comm,current->pid'
>+ccflags-y += -D'pr_fmt(fmt)="aufs40%s:%d:%s[%d]:40"fmt,__func__,__LINE__,current->comm,current->pid'

Sadly, this doesn’t work either:

CC [M] fs/aufs/module.o
In file included from /tmp/buildd/linux-2.6-3.2~rc7/debian/build/source_m68k_none/include/linux/hardirq.h:7:0,
from /tmp/buildd/linux-2.6-3.2~rc7/debian/build/source_m68k_none/arch/m68k/include/asm/irqflags.h:6,
from /tmp/buildd/linux-2.6-3.2~rc7/debian/build/source_m68k_none/include/linux/irqflags.h:15,
from /tmp/buildd/linux-2.6-3.2~rc7/debian/build/source_m68k_none/include/linux/spinlock.h:53,
from /tmp/buildd/linux-2.6-3.2~rc7/debian/build/source_m68k_none/include/linux/seqlock.h:29,
from /tmp/buildd/linux-2.6-3.2~rc7/debian/build/source_m68k_none/include/linux/time.h:8,
from /tmp/buildd/linux-2.6-3.2~rc7/debian/build/source_m68k_none/include/linux/stat.h:60,
from /tmp/buildd/linux-2.6-3.2~rc7/debian/build/source_m68k_none/include/linux/module.h:10,
from /tmp/buildd/linux-2.6-3.2~rc7/debian/build/source_m68k_none/fs/aufs/module.c:23:
/tmp/buildd/linux-2.6-3.2~rc7/debian/build/source_m68k_none/arch/m68k/include/asm/hardirq.h: In function 'ack_bad_irq':
/tmp/buildd/linux-2.6-3.2~rc7/debian/build/source_m68k_none/arch/m68k/include/asm/hardirq.h:23:2: error: dereferencing pointer to incomplete type
/tmp/buildd/linux-2.6-3.2~rc7/debian/build/source_m68k_none/arch/m68k/include/asm/hardirq.h:23:2: error: dereferencing pointer to incomplete type
make[7]: *** [fs/aufs/module.o] Error 1

This one does work:
http://lists.debian.org/debian-kernel/2011/12/msg00474.html

The difference between a static inline function and a præprocessor
macro makes the difference. I know, now, why I never used the former
myself ☺ I guess “current” is not defined there.


sfjro@users.sourceforge.net dixit:

>I don't think the "current" macro will be a problem, but I want you to

It does. Also, read this:
http://people.netfilter.org/rusty/unreliable-guides/kernel-hacking/routines-current.html
“This global variable (really a macro) contains a pointer to the
current task structure, so is only valid in user context. For example,
when a process makes a system call, this will point to the task
structure of the calling process. It is not NULL in interrupt context.”

So I don’t know how safe it is to dereference 'current' in the inline
function ack_bad_irq (probably, not at all). On the other hand, the
ack_bad_irq function is probably not expanded in aufs3… so we could
go on. I can try a patch based on yours, but probably the best fix
would be to not use a static inline function in m68k.

bye,
//mirabilos
--
“Having a smoking section in a restaurant is like having
a peeing section in a swimming pool.”
-- Edward Burr


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: Pine.BSM.4.64L.1112312202120.14351@herc.mirbsd.org ">http://lists.debian.org/Pine.BSM.4.64L.1112312202120.14351@herc.mirbsd.org
 
Old 12-31-2011, 09:31 PM
Thorsten Glaser
 
Default aufs: Do not refer to AUFS_NAME in pr_fmt

Dixi quod…

>go on. I can try a patch based on yours, but probably the best fix

What do you think of this (untested)? I omitted the Documentation/**
patch as that part it not present in the Debian Linux kernel.

Please do not commit this anywhere until I say I have tested it.

bye,
//mirabilos
--
I believe no one can invent an algorithm. One just happens to hit upon it
when God enlightens him. Or only God invents algorithms, we merely copy them.
If you don't believe in God, just consider God as Nature if you won't deny
existence. -- Coywolf Qi HuntFrom 7431e1ffad6aafa36fa8dd0459c066fada25e1d6 Mon Sep 17 00:00:00 2001
From: Thorsten Glaser <tg@mirbsd.org>
Date: Sat, 31 Dec 2011 22:27:15 +0000
Subject: [PATCH] =?UTF-8?q?move=20AUFS=5FNAME=20and=20aufs=E2=80=99=20pr= 5Ff?=
=?UTF-8?q?mt=20into=20their=20own=20header?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

based on a patch from sfjro@users.sourceforge.net
in <9569.1325306817@jrobl> but changed to also move
the pr_fmt definition off the Makefile and into the
header, and include the definition of current and
the header which details its structure so it can be
dereferenced, which may or may not be safe though…
see <Pine.BSM.4.64L.1112312202120.14351@herc.mirbsd.or g>

Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
---
fs/aufs/Makefile | 3 +--
include/linux/Kbuild | 1 +
include/linux/aufs_name.h | 29 +++++++++++++++++++++++++++++
include/linux/aufs_type.h | 2 +-
4 files changed, 32 insertions(+), 3 deletions(-)
create mode 100644 include/linux/aufs_name.h

diff --git a/fs/aufs/Makefile b/fs/aufs/Makefile
index 46615fe..63b8a72 100644
--- a/fs/aufs/Makefile
+++ b/fs/aufs/Makefile
@@ -8,8 +8,7 @@ endif
# cf. include/linux/kernel.h
# enable pr_debug
ccflags-y += -DDEBUG
-# sparse doesn't allow spaces
-ccflags-y += -D'pr_fmt(fmt)=AUFS_NAME"40%s:%d:%s[%d]:40"fmt,__func__,__LINE__,current->comm,current->pid'
+ccflags-y += -include linux/aufs_name.h

obj-$(CONFIG_AUFS_FS) += aufs.o
aufs-y := module.o sbinfo.o super.o branch.o xino.o sysaufs.o opts.o
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 29f386b..fc6d2d2 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -65,6 +65,7 @@ header-y += atmppp.h
header-y += atmsap.h
header-y += atmsvc.h
header-y += audit.h
+header-y += aufs_name.h
header-y += aufs_type.h
header-y += auto_fs.h
header-y += auto_fs4.h
diff --git a/include/linux/aufs_name.h b/include/linux/aufs_name.h
new file mode 100644
index 0000000..fda7f5c
--- /dev/null
+++ b/include/linux/aufs_name.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2011 Junjiro R. Okajima
+ * Copyright (c) 2011 Thorsten Glaser
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __AUFS_NAME_H__
+#define __AUFS_NAME_H__
+
+/* includes <asm/current.h> and defines struct task_struct */
+#include <linux/sched.h>
+
+#define AUFS_NAME "aufs"
+#define pr_fmt(fmt) AUFS_NAME"40%s:%d:%s[%d]:40"fmt,__func__,__LINE__,current->comm,current->pid
+
+#endif /* __AUFS_NAME_H__ */
diff --git a/include/linux/aufs_type.h b/include/linux/aufs_type.h
index 9443906..16b0bf8 100644
--- a/include/linux/aufs_type.h
+++ b/include/linux/aufs_type.h
@@ -28,6 +28,7 @@
#include <stdint.h>
#include <sys/types.h>
#endif
+#include <linux/aufs_name.h>

#define AUFS_VERSION "3.x-rcN-20111114"

@@ -58,7 +59,6 @@ typedef int16_t aufs_bindex_t;

/* ---------------------------------------------------------------------- */

-#define AUFS_NAME "aufs"
#define AUFS_FSTYPE AUFS_NAME

#define AUFS_ROOT_INO 2
--
1.7.7.3
 
Old 12-31-2011, 09:55 PM
Thorsten Glaser
 
Default aufs: Do not refer to AUFS_NAME in pr_fmt

Dixi quod…

>This one does work:
>http://lists.debian.org/debian-kernel/2011/12/msg00474.html

Geert, would you please apply the attached patch, independent of
whether we are able to find a solution in aufs, as it avoids an
entire problem class?

Groeten uit Duitsland,
//mirabilos
--
[...] if maybe ext3fs wasn't a better pick, or jfs, or maybe reiserfs, oh but
what about xfs, and if only i had waited until reiser4 was ready... in the be-
ginning, there was ffs, and in the middle, there was ffs, and at the end, there
was still ffs, and the sys admins knew it was good. -- Ted Unangst über *fsFrom fda2529371f8cc8879877ca3f3eb9dfbaafb9755 Mon Sep 17 00:00:00 2001
From: Thorsten Glaser <tg@mirbsd.org>
Date: Sat, 31 Dec 2011 22:48:52 +0000
Subject: [PATCH] replace inline ack_bad_irq with a block macro to avoid error
propagation

If any file including (directly or indirectly) hardirq.h redefines
pr_fmt to something containing some value not available at hardirq
inclusion time, defining a static inline function fails, whereas a
macro can always be defined (and need not even be expanded once in
the translation unit with pr_fmt redefined while all static inline
functions will always be expanded).

Fixes: http://lists.debian.org/debian-kernel/2011/12/msg00474.html

Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
---
arch/m68k/include/asm/hardirq.h | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/m68k/include/asm/hardirq.h b/arch/m68k/include/asm/hardirq.h
index db30ed2..a2e00e7 100644
--- a/arch/m68k/include/asm/hardirq.h
+++ b/arch/m68k/include/asm/hardirq.h
@@ -18,10 +18,10 @@

#ifdef CONFIG_MMU

-static inline void ack_bad_irq(unsigned int irq)
-{
- pr_crit("unexpected IRQ trap at vector %02x
", irq);
-}
+#define ack_bad_irq(irq) do {
+ pr_crit("unexpected IRQ trap at vector %02x
",
+ (unsigned int)(irq));
+} while (/* CONSTCOND */ 0)

/* entry.S is sensitive to the offsets of these fields */
typedef struct {
--
1.7.7.3
 
Old 01-01-2012, 12:15 AM
Thorsten Glaser
 
Default aufs: Do not refer to AUFS_NAME in pr_fmt

Dixi quod…

>What do you think of this (untested)?

well, it compiles (with warnings, see below). I’ll know if it links
and loads tomorrow, I guess (unless the other problems are still
there).

/tmp/buildd/linux-2.6-3.2~rc7/debian/build/source_m68k_none/include/linux/aufs_name.h:27:0: warning: "pr_fmt" redefined [enabled by default]
/tmp/buildd/linux-2.6-3.2~rc7/debian/build/source_m68k_none/include/linux/printk.h:152:0: note: this is the location of the previous definition

Version 2 of this patch (attached) fixes this by #undef pr_fmt
before defining it. Please decide whether you want to fix it
like this. Independent of this, I’ve asked the m68k maintainer
to change away from static inline to a cpp macro, to avoid this
issue fully. This should not influence your decision, though.

bye,
//mirabilos
--
FWIW, I'm quite impressed with mksh interactively. I thought it was much
*much* more bare bones. But it turns out it beats the living hell out of
ksh93 in that respect. I'd even consider it for my daily use if I hadn't
wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mkshFrom debdad28232a9c84f135fa1b7aa9d137b72ab4d8 Mon Sep 17 00:00:00 2001
From: Thorsten Glaser <tg@mirbsd.org>
Date: Sat, 31 Dec 2011 22:27:15 +0000
Subject: [PATCH] =?UTF-8?q?move=20AUFS=5FNAME=20and=20aufs=E2=80=99=20pr= 5Ff?=
=?UTF-8?q?mt=20into=20their=20own=20header?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

based on a patch from sfjro@users.sourceforge.net
in <9569.1325306817@jrobl> but changed to also move
the pr_fmt definition off the Makefile and into the
header, and include the definition of current and
the header which details its structure so it can be
dereferenced, which may or may not be safe though…
see <Pine.BSM.4.64L.1112312202120.14351@herc.mirbsd.or g>

Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
---
fs/aufs/Makefile | 3 +--
include/linux/Kbuild | 1 +
include/linux/aufs_name.h | 31 +++++++++++++++++++++++++++++++
include/linux/aufs_type.h | 2 +-
4 files changed, 34 insertions(+), 3 deletions(-)
create mode 100644 include/linux/aufs_name.h

diff --git a/fs/aufs/Makefile b/fs/aufs/Makefile
index 46615fe..63b8a72 100644
--- a/fs/aufs/Makefile
+++ b/fs/aufs/Makefile
@@ -8,8 +8,7 @@ endif
# cf. include/linux/kernel.h
# enable pr_debug
ccflags-y += -DDEBUG
-# sparse doesn't allow spaces
-ccflags-y += -D'pr_fmt(fmt)=AUFS_NAME"40%s:%d:%s[%d]:40"fmt,__func__,__LINE__,current->comm,current->pid'
+ccflags-y += -include linux/aufs_name.h

obj-$(CONFIG_AUFS_FS) += aufs.o
aufs-y := module.o sbinfo.o super.o branch.o xino.o sysaufs.o opts.o
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 29f386b..fc6d2d2 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -65,6 +65,7 @@ header-y += atmppp.h
header-y += atmsap.h
header-y += atmsvc.h
header-y += audit.h
+header-y += aufs_name.h
header-y += aufs_type.h
header-y += auto_fs.h
header-y += auto_fs4.h
diff --git a/include/linux/aufs_name.h b/include/linux/aufs_name.h
new file mode 100644
index 0000000..8c2c494
--- /dev/null
+++ b/include/linux/aufs_name.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2011 Junjiro R. Okajima
+ * Copyright (c) 2011 Thorsten Glaser
+ *
+ * This program, aufs is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __AUFS_NAME_H__
+#define __AUFS_NAME_H__
+
+/* includes <asm/current.h> and defines struct task_struct */
+#include <linux/sched.h>
+
+#define AUFS_NAME "aufs"
+
+#undef pr_fmt
+#define pr_fmt(fmt) AUFS_NAME"40%s:%d:%s[%d]:40"fmt,__func__,__LINE__,current->comm,current->pid
+
+#endif /* __AUFS_NAME_H__ */
diff --git a/include/linux/aufs_type.h b/include/linux/aufs_type.h
index 9443906..16b0bf8 100644
--- a/include/linux/aufs_type.h
+++ b/include/linux/aufs_type.h
@@ -28,6 +28,7 @@
#include <stdint.h>
#include <sys/types.h>
#endif
+#include <linux/aufs_name.h>

#define AUFS_VERSION "3.x-rcN-20111114"

@@ -58,7 +59,6 @@ typedef int16_t aufs_bindex_t;

/* ---------------------------------------------------------------------- */

-#define AUFS_NAME "aufs"
#define AUFS_FSTYPE AUFS_NAME

#define AUFS_ROOT_INO 2
--
1.7.7.3
 
Old 01-01-2012, 07:47 AM
Geert Uytterhoeven
 
Default aufs: Do not refer to AUFS_NAME in pr_fmt

Hi Thorsten,

On Sat, Dec 31, 2011 at 23:55, Thorsten Glaser <tg@mirbsd.de> wrote:
> Dixi quod…
>
>>This one does work:
>>http://lists.debian.org/debian-kernel/2011/12/msg00474.html
>
> Geert, would you please apply the attached patch, independent of
> whether we are able to find a solution in aufs, as it avoids an
> entire problem class?

Sorry, static inline functions are preferred over macros, unless there's
a really good reason. Out-of-tree kernel code doing stupid things doesn't
count.

Gr{oetje,eeting}s,

* * * * * * * * * * * * Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
* * * * * * * * * * * * * ** ** -- Linus Torvalds


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAMuHMdWoJYkRJ8NnS8xLnmBF9+tyNYew+O9+0O=v6tD0MZzi8 A@mail.gmail.com">http://lists.debian.org/CAMuHMdWoJYkRJ8NnS8xLnmBF9+tyNYew+O9+0O=v6tD0MZzi8 A@mail.gmail.com
 
Old 01-01-2012, 01:48 PM
Thorsten Glaser
 
Default aufs: Do not refer to AUFS_NAME in pr_fmt

Geert Uytterhoeven dixit:

>Sorry, static inline functions are preferred over macros, unless there's

Can I have reasons? (Also out of curiosity.)

>a really good reason. Out-of-tree kernel code doing stupid things doesn't

I see it like this:

EVERY file that, directly or indirectly, includes hardirq.h has the
overhead of having GCC compile that static inline function, even if
it’s never used (and thus never emitted into the object file). Also,
redefining pr_fmt appears to be a desired thing, not a stupid thing;
if a static inline function uses pr_fmt in the timeframe between it
being redefined and the redefined one’s prerequisites being availab-
le, it would necessarily fail.

In contrast to that, a cpp macro is only evaluated when it’s actual-
ly needed, and by then, the prerequisites would probably be availab-
le. It also has less compile-time overhead (in this case, since the
hardirq.h file is probably included in more files than it is needed,
whereas macros slow down when you use them more than once in all fi-
les they’re defined in.

bye,
//mirabilos
--
Sometimes they [people] care too much: pretty printers [and syntax highligh-
ting, d.A.] mechanically produce pretty output that accentuates irrelevant
detail in the program, which is as sensible as putting all the prepositions
in English text in bold font. -- Rob Pike in "Notes on Programming in C"


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: Pine.BSM.4.64L.1201011442550.20109@herc.mirbsd.org ">http://lists.debian.org/Pine.BSM.4.64L.1201011442550.20109@herc.mirbsd.org
 
Old 01-02-2012, 01:04 AM
 
Default aufs: Do not refer to AUFS_NAME in pr_fmt

Geert Uytterhoeven:
> If the Makefile refers to the macro, perhaps the Makefile should
> define it, and pass it with -D?

??
Instead of defining it in Makefile, "-imacros linux/aufs_name.h" is
added. Or do you mean -imacros is useless?


J. R. Okajima


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 5496.1325469852@jrobl">http://lists.debian.org/5496.1325469852@jrobl
 

Thread Tools




All times are GMT. The time now is 09:41 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org