* [BK PATCH] AOE fixes for 2.6.11 @ 2005-03-10 0:18 Greg KH 2005-03-10 0:19 ` [PATCH] AoE warning on 64-bit archs Greg KH 0 siblings, 1 reply; 7+ messages in thread From: Greg KH @ 2005-03-10 0:18 UTC (permalink / raw) To: torvalds, akpm; +Cc: linux-kernel Hi, Here are some AOE driver fixes and documentation updates. These have all been in the -mm releases for a while. Please pull from: bk://kernel.bkbits.net/gregkh/linux/2.6.11/aoe Individual patches will follow, sent to the linux-kernel list. thanks, greg k-h Documentation/aoe/aoe.txt | 13 +++++++++--- Documentation/aoe/status.sh | 7 ++++-- Documentation/aoe/udev-install.sh | 36 ++++++++++++++++++++++++++++----- Documentation/aoe/udev.txt | 23 +++++++++++++++++++++ drivers/block/aoe/aoe.h | 1 drivers/block/aoe/aoechr.c | 41 ++------------------------------------ drivers/block/aoe/aoecmd.c | 8 ++++--- 7 files changed, 77 insertions(+), 52 deletions(-) ----- Alexander Nyberg: o AoE warning on 64-bit archs Ed L. Cashin: o aoe: drivers/block/aoe/aoechr.c cleanups o aoe status.sh: handle sysfs not in /etc/mtab o aoe: fail IO on disk errors o aoe: update documentation for udev users o aoe: add documentation for udev users ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] AoE warning on 64-bit archs 2005-03-10 0:18 [BK PATCH] AOE fixes for 2.6.11 Greg KH @ 2005-03-10 0:19 ` Greg KH 2005-03-10 0:19 ` [PATCH] aoe: add documentation for udev users Greg KH 0 siblings, 1 reply; 7+ messages in thread From: Greg KH @ 2005-03-10 0:19 UTC (permalink / raw) To: linux-kernel; +Cc: alexn ChangeSet 1.2035, 2005/03/09 10:20:37-08:00, alexn@dsv.su.se [PATCH] AoE warning on 64-bit archs I just accidently built AoE on x86-64 and it emits a warning due to conversion of types of different size, trivial fix: Signed-off-by: Alexander Nyberg <alexn@dsv.su.se> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> drivers/block/aoe/aoechr.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff -Nru a/drivers/block/aoe/aoechr.c b/drivers/block/aoe/aoechr.c --- a/drivers/block/aoe/aoechr.c 2005-03-09 16:16:13 -08:00 +++ b/drivers/block/aoe/aoechr.c 2005-03-09 16:16:13 -08:00 @@ -178,13 +178,13 @@ static ssize_t aoechr_read(struct file *filp, char __user *buf, size_t cnt, loff_t *off) { - int n; + unsigned long n; char *mp; struct ErrMsg *em; ssize_t len; ulong flags; - n = (int) filp->private_data; + n = (unsigned long) filp->private_data; switch (n) { case MINOR_ERR: spin_lock_irqsave(&emsgs_lock, flags); ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] aoe: add documentation for udev users 2005-03-10 0:19 ` [PATCH] AoE warning on 64-bit archs Greg KH @ 2005-03-10 0:19 ` Greg KH 2005-03-10 0:19 ` [PATCH] aoe: update " Greg KH 0 siblings, 1 reply; 7+ messages in thread From: Greg KH @ 2005-03-10 0:19 UTC (permalink / raw) To: linux-kernel; +Cc: ecashin ChangeSet 1.2036, 2005/03/09 10:20:56-08:00, ecashin@coraid.com [PATCH] aoe: add documentation for udev users add documentation for udev users Signed-off-by: Ed L. Cashin <ecashin@coraid.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Documentation/aoe/aoe.txt | 13 ++++++++++--- Documentation/aoe/udev-install.sh | 22 ++++++++++++++++++++++ Documentation/aoe/udev.txt | 23 +++++++++++++++++++++++ 3 files changed, 55 insertions(+), 3 deletions(-) diff -Nru a/Documentation/aoe/aoe.txt b/Documentation/aoe/aoe.txt --- a/Documentation/aoe/aoe.txt 2005-03-09 16:16:07 -08:00 +++ b/Documentation/aoe/aoe.txt 2005-03-09 16:16:07 -08:00 @@ -6,9 +6,16 @@ CREATING DEVICE NODES - Users of udev should find device nodes created automatically. Two - scripts are provided in Documentation/aoe as examples of static - device node creation for using the aoe driver. + Users of udev should find the block device nodes created + automatically, but to create all the necessary device nodes, use the + udev configuration rules provided in udev.txt (in this directory). + + There is a udev-install.sh script that shows how to install these + rules on your system. + + If you are not using udev, two scripts are provided in + Documentation/aoe as examples of static device node creation for + using the aoe driver. rm -rf /dev/etherd sh Documentation/aoe/mkdevs.sh /dev/etherd diff -Nru a/Documentation/aoe/udev-install.sh b/Documentation/aoe/udev-install.sh --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/Documentation/aoe/udev-install.sh 2005-03-09 16:16:07 -08:00 @@ -0,0 +1,22 @@ +# install the aoe-specific udev rules from udev.txt into +# the system's udev configuration +# + +me="`basename $0`" + +# find udev.conf, often /etc/udev/udev.conf +# (or environment can specify where to find udev.conf) +# +if test -z "$conf"; then + conf="`find /etc -type f -name udev.conf 2> /dev/null`" +fi +if test -z "$conf" || test ! -r $conf; then + echo "$me Error: could not find readable udev.conf in /etc" 1>&2 + exit 1 +fi + +# find the directory where udev rules are stored, often +# /etc/udev/rules.d +# +rules_d="`sed -n '/^udev_rules=/{ s!udev_rules=!!; s!\"!!g; p; }' $conf`" +test "$rules_d" && sh -xc "cp `dirname $0`/udev.txt $rules_d/60-aoe.rules" diff -Nru a/Documentation/aoe/udev.txt b/Documentation/aoe/udev.txt --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/Documentation/aoe/udev.txt 2005-03-09 16:16:07 -08:00 @@ -0,0 +1,23 @@ +# These rules tell udev what device nodes to create for aoe support. +# They may be installed along the following lines (adjusted to what +# you see on your system). +# +# ecashin@makki ~$ su +# Password: +# bash# find /etc -type f -name udev.conf +# /etc/udev/udev.conf +# bash# grep udev_rules= /etc/udev/udev.conf +# udev_rules="/etc/udev/rules.d/" +# bash# ls /etc/udev/rules.d/ +# 10-wacom.rules 50-udev.rules +# bash# cp /path/to/linux-2.6.xx/Documentation/aoe/udev.txt \ +# /etc/udev/rules.d/60-aoe.rules +# + +# aoe char devices +SUBSYSTEM="aoe", KERNEL="discover", NAME="etherd/%k", GROUP="disk", MODE="0220" +SUBSYSTEM="aoe", KERNEL="err", NAME="etherd/%k", GROUP="disk", MODE="0440" +SUBSYSTEM="aoe", KERNEL="interfaces", NAME="etherd/%k", GROUP="disk", MODE="0220" + +# aoe block devices +KERNEL="etherd*", NAME="%k", GROUP="disk" ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] aoe: update documentation for udev users 2005-03-10 0:19 ` [PATCH] aoe: add documentation for udev users Greg KH @ 2005-03-10 0:19 ` Greg KH 2005-03-10 0:19 ` [PATCH] aoe: fail IO on disk errors Greg KH 0 siblings, 1 reply; 7+ messages in thread From: Greg KH @ 2005-03-10 0:19 UTC (permalink / raw) To: linux-kernel; +Cc: ecashin ChangeSet 1.2037, 2005/03/09 10:21:15-08:00, ecashin@coraid.com [PATCH] aoe: update documentation for udev users Bodo Eggert <7eggert@gmx.de> writes: > Ed L Cashin <ecashin@coraid.com> wrote: > >> +if=A0test=A0-z=A0"$conf";=A0then >> +=A0=A0=A0=A0=A0=A0=A0=A0conf=3D"`find=A0/etc=A0-type=A0f=A0-name=A0udev= .conf=A02>=A0/dev/null`" >> +fi >> +if=A0test=A0-z=A0"$conf"=A0||=A0test=A0!=A0-r=A0$conf;=A0then >> +=A0=A0=A0=A0=A0=A0=A0=A0echo=A0"$me=A0Error:=A0could=A0not=A0find=A0rea= dable=A0udev.conf=A0in=A0/etc"=A01>&2 >> +=A0=A0=A0=A0=A0=A0=A0=A0exit=A01 >> +fi > > This will fail and print > --- > bash: test: etc/udev.conf: binary operator expected > --- > if there is more than one udev.conf. > > Fix: Always put quotes around variables. Thanks. With the changes below, it still will complain if it finds more than one udev.conf, but only if /etc/udev/udev.conf doesn't exist. Quote all shell variables, and use /etc/udev/udev.conf if available. Signed-off-by: Ed L. Cashin <ecashin@coraid.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Documentation/aoe/udev-install.sh | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff -Nru a/Documentation/aoe/udev-install.sh b/Documentation/aoe/udev-install.sh --- a/Documentation/aoe/udev-install.sh 2005-03-09 16:16:00 -08:00 +++ b/Documentation/aoe/udev-install.sh 2005-03-09 16:16:00 -08:00 @@ -8,11 +8,15 @@ # (or environment can specify where to find udev.conf) # if test -z "$conf"; then - conf="`find /etc -type f -name udev.conf 2> /dev/null`" -fi -if test -z "$conf" || test ! -r $conf; then - echo "$me Error: could not find readable udev.conf in /etc" 1>&2 - exit 1 + if test -r /etc/udev/udev.conf; then + conf=/etc/udev/udev.conf + else + conf="`find /etc -type f -name udev.conf 2> /dev/null`" + if test -z "$conf" || test ! -r "$conf"; then + echo "$me Error: no udev.conf found" 1>&2 + exit 1 + fi + fi fi # find the directory where udev rules are stored, often ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] aoe: fail IO on disk errors 2005-03-10 0:19 ` [PATCH] aoe: update " Greg KH @ 2005-03-10 0:19 ` Greg KH 2005-03-10 0:19 ` [PATCH] aoe status.sh: handle sysfs not in /etc/mtab Greg KH 0 siblings, 1 reply; 7+ messages in thread From: Greg KH @ 2005-03-10 0:19 UTC (permalink / raw) To: linux-kernel; +Cc: ecashin ChangeSet 1.2038, 2005/03/09 10:21:33-08:00, ecashin@coraid.com [PATCH] aoe: fail IO on disk errors This patch makes disk errors fail the IO instead of getting logged and ignored. Fail IO on disk errors Signed-off-by: Ed L. Cashin <ecashin@coraid.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> drivers/block/aoe/aoecmd.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff -Nru a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c --- a/drivers/block/aoe/aoecmd.c 2005-03-09 16:15:53 -08:00 +++ b/drivers/block/aoe/aoecmd.c 2005-03-09 16:15:53 -08:00 @@ -416,7 +416,9 @@ if (ahin->cmdstat & 0xa9) { /* these bits cleared on success */ printk(KERN_CRIT "aoe: aoecmd_ata_rsp: ata error cmd=%2.2Xh " - "stat=%2.2Xh\n", ahout->cmdstat, ahin->cmdstat); + "stat=%2.2Xh from e%ld.%ld\n", + ahout->cmdstat, ahin->cmdstat, + d->aoemajor, d->aoeminor); if (buf) buf->flags |= BUFFL_FAIL; } else { @@ -458,8 +460,8 @@ if (buf) { buf->nframesout -= 1; if (buf->nframesout == 0 && buf->resid == 0) { - n = !(buf->flags & BUFFL_FAIL); - bio_endio(buf->bio, buf->bio->bi_size, 0); + n = (buf->flags & BUFFL_FAIL) ? -EIO : 0; + bio_endio(buf->bio, buf->bio->bi_size, n); mempool_free(buf, d->bufpool); } } ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] aoe status.sh: handle sysfs not in /etc/mtab 2005-03-10 0:19 ` [PATCH] aoe: fail IO on disk errors Greg KH @ 2005-03-10 0:19 ` Greg KH 2005-03-10 0:19 ` [PATCH] aoe: drivers/block/aoe/aoechr.c cleanups Greg KH 0 siblings, 1 reply; 7+ messages in thread From: Greg KH @ 2005-03-10 0:19 UTC (permalink / raw) To: linux-kernel; +Cc: ecashin ChangeSet 1.2039, 2005/03/09 10:21:52-08:00, ecashin@coraid.com [PATCH] aoe status.sh: handle sysfs not in /etc/mtab Suse 9.1 Pro doesn't put /sys in /etc/mtab. This patch makes the example aoe status.sh script work when sysfs is mounted but `mount` doesn't mention sysfs. aoe status.sh: handle sysfs not in /etc/mtab Signed-off-by: Ed L. Cashin <ecashin@coraid.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Documentation/aoe/status.sh | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff -Nru a/Documentation/aoe/status.sh b/Documentation/aoe/status.sh --- a/Documentation/aoe/status.sh 2005-03-09 16:15:46 -08:00 +++ b/Documentation/aoe/status.sh 2005-03-09 16:15:46 -08:00 @@ -4,10 +4,13 @@ set -e format="%8s\t%8s\t%8s\n" me=`basename $0` +sysd=${sysfs_dir:-/sys} # printf "$format" device mac netif state -test -z "`mount | grep sysfs`" && { +# Suse 9.1 Pro doesn't put /sys in /etc/mtab +#test -z "`mount | grep sysfs`" && { +test ! -d "$sysd/block" && { echo "$me Error: sysfs is not mounted" 1>&2 exit 1 } @@ -16,7 +19,7 @@ exit 1 } -for d in `ls -d /sys/block/etherd* 2>/dev/null | grep -v p` end; do +for d in `ls -d $sysd/block/etherd* 2>/dev/null | grep -v p` end; do # maybe ls comes up empty, so we use "end" test $d = end && continue ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] aoe: drivers/block/aoe/aoechr.c cleanups 2005-03-10 0:19 ` [PATCH] aoe status.sh: handle sysfs not in /etc/mtab Greg KH @ 2005-03-10 0:19 ` Greg KH 0 siblings, 0 replies; 7+ messages in thread From: Greg KH @ 2005-03-10 0:19 UTC (permalink / raw) To: linux-kernel; +Cc: ecashin ChangeSet 1.2040, 2005/03/09 10:22:12-08:00, ecashin@coraid.com [PATCH] aoe: drivers/block/aoe/aoechr.c cleanups Adrian Bunk <bunk@stusta.de> writes: > This patch contains the following cleanups: > - make the needlessly global struct aoe_fops static > - #if 0 the unused global function aoechr_hdump Thanks for the patch. The original patch leaves the prototype for aoechr_hdump in aoe.h, but since this function is just for debugging, it seems better to just take both prototype and definition out. remove aoechr_hdump make aoe_fops static Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Ed L. Cashin <ecashin@coraid.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> drivers/block/aoe/aoe.h | 1 - drivers/block/aoe/aoechr.c | 37 +------------------------------------ 2 files changed, 1 insertion(+), 37 deletions(-) diff -Nru a/drivers/block/aoe/aoe.h b/drivers/block/aoe/aoe.h --- a/drivers/block/aoe/aoe.h 2005-03-09 16:15:39 -08:00 +++ b/drivers/block/aoe/aoe.h 2005-03-09 16:15:39 -08:00 @@ -143,7 +143,6 @@ int aoechr_init(void); void aoechr_exit(void); void aoechr_error(char *); -void aoechr_hdump(char *, int len); void aoecmd_work(struct aoedev *d); void aoecmd_cfg(ushort, unsigned char); diff -Nru a/drivers/block/aoe/aoechr.c b/drivers/block/aoe/aoechr.c --- a/drivers/block/aoe/aoechr.c 2005-03-09 16:15:39 -08:00 +++ b/drivers/block/aoe/aoechr.c 2005-03-09 16:15:39 -08:00 @@ -99,41 +99,6 @@ up(&emsgs_sema); } -#define PERLINE 16 -void -aoechr_hdump(char *buf, int n) -{ - int bufsiz; - char *fbuf; - int linelen; - char *p, *e, *fp; - - bufsiz = n * 3; /* 2 hex digits and a space */ - bufsiz += n / PERLINE + 1; /* the newline characters */ - bufsiz += 1; /* the final '\0' */ - - fbuf = kmalloc(bufsiz, GFP_ATOMIC); - if (!fbuf) { - printk(KERN_INFO - "%s: cannot allocate memory\n", - __FUNCTION__); - return; - } - - for (p = buf; n <= 0;) { - linelen = n > PERLINE ? PERLINE : n; - n -= linelen; - - fp = fbuf; - for (e=p+linelen; p<e; p++) - fp += sprintf(fp, "%2.2X ", *p & 255); - sprintf(fp, "\n"); - aoechr_error(fbuf); - } - - kfree(fbuf); -} - static ssize_t aoechr_write(struct file *filp, const char __user *buf, size_t cnt, loff_t *offp) { @@ -233,7 +198,7 @@ } } -struct file_operations aoe_fops = { +static struct file_operations aoe_fops = { .write = aoechr_write, .read = aoechr_read, .open = aoechr_open, ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2005-03-10 3:24 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2005-03-10 0:18 [BK PATCH] AOE fixes for 2.6.11 Greg KH 2005-03-10 0:19 ` [PATCH] AoE warning on 64-bit archs Greg KH 2005-03-10 0:19 ` [PATCH] aoe: add documentation for udev users Greg KH 2005-03-10 0:19 ` [PATCH] aoe: update " Greg KH 2005-03-10 0:19 ` [PATCH] aoe: fail IO on disk errors Greg KH 2005-03-10 0:19 ` [PATCH] aoe status.sh: handle sysfs not in /etc/mtab Greg KH 2005-03-10 0:19 ` [PATCH] aoe: drivers/block/aoe/aoechr.c cleanups Greg KH
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox