Skip to content

Commit

Permalink
Merge with kernel.org:/pub/scm/linux/kernel/git/gregkh/aoe-2.6.git/
Browse files Browse the repository at this point in the history
for 11 aoe bugfix patches.
  • Loading branch information
Linus Torvalds committed Apr 19, 2005
2 parents c79bea0 + a4b3836 commit c3c6619
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 64 deletions.
1 change: 1 addition & 0 deletions Documentation/aoe/mkdevs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ n_partitions=${n_partitions:-16}

if test "$#" != "1"; then
echo "Usage: sh `basename $0` {dir}" 1>&2
echo " n_partitions=16 sh `basename $0` {dir}" 1>&2
exit 1
fi
dir=$1
Expand Down
1 change: 1 addition & 0 deletions Documentation/aoe/mkshelf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

if test "$#" != "2"; then
echo "Usage: sh `basename $0` {dir} {shelfaddress}" 1>&2
echo " n_partitions=16 sh `basename $0` {dir} {shelfaddress}" 1>&2
exit 1
fi
n_partitions=${n_partitions:-16}
Expand Down
14 changes: 14 additions & 0 deletions Documentation/aoe/todo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
There is a potential for deadlock when allocating a struct sk_buff for
data that needs to be written out to aoe storage. If the data is
being written from a dirty page in order to free that page, and if
there are no other pages available, then deadlock may occur when a
free page is needed for the sk_buff allocation. This situation has
not been observed, but it would be nice to eliminate any potential for
deadlock under memory pressure.

Because ATA over Ethernet is not fragmented by the kernel's IP code,
the destructore member of the struct sk_buff is available to the aoe
driver. By using a mempool for allocating all but the first few
sk_buffs, and by registering a destructor, we should be able to
efficiently allocate sk_buffs without introducing any potential for
deadlock.
6 changes: 5 additions & 1 deletion Documentation/aoe/udev-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ fi
# /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"
if test -z "$rules_d" || test ! -d "$rules_d"; then
echo "$me Error: cannot find udev rules directory" 1>&2
exit 1
fi
sh -xc "cp `dirname $0`/udev.txt $rules_d/60-aoe.rules"
23 changes: 15 additions & 8 deletions drivers/block/aoe/aoe.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
/* Copyright (c) 2004 Coraid, Inc. See COPYING for GPL terms. */
#define VERSION "5"
#define VERSION "6"
#define AOE_MAJOR 152
#define DEVICE_NAME "aoe"

/* set AOE_PARTITIONS to 1 to use whole-disks only
* default is 16, which is 15 partitions plus the whole disk
*/
#ifndef AOE_PARTITIONS
#define AOE_PARTITIONS 16
#endif

#define SYSMINOR(aoemajor, aoeminor) ((aoemajor) * 10 + (aoeminor))
#define AOEMAJOR(sysminor) ((sysminor) / 10)
#define AOEMINOR(sysminor) ((sysminor) % 10)
Expand Down Expand Up @@ -34,13 +39,13 @@ enum {
struct aoe_hdr {
unsigned char dst[6];
unsigned char src[6];
unsigned char type[2];
__be16 type;
unsigned char verfl;
unsigned char err;
unsigned char major[2];
__be16 major;
unsigned char minor;
unsigned char cmd;
unsigned char tag[4];
__be32 tag;
};

struct aoe_atahdr {
Expand All @@ -58,8 +63,8 @@ struct aoe_atahdr {
};

struct aoe_cfghdr {
unsigned char bufcnt[2];
unsigned char fwver[2];
__be16 bufcnt;
__be16 fwver;
unsigned char res;
unsigned char aoeccmd;
unsigned char cslen[2];
Expand All @@ -85,6 +90,7 @@ enum {

struct buf {
struct list_head bufs;
ulong start_time; /* for disk stats */
ulong flags;
ulong nframesout;
char *bufaddr;
Expand Down Expand Up @@ -125,7 +131,8 @@ struct aoedev {
struct timer_list timer;
spinlock_t lock;
struct net_device *ifp; /* interface ed is attached to */
struct sk_buff *skblist;/* packets needing to be sent */
struct sk_buff *sendq_hd; /* packets needing to be sent, list head */
struct sk_buff *sendq_tl;
mempool_t *bufpool; /* for deadlock-free Buf allocation */
struct list_head bufq; /* queue of bios to work on */
struct buf *inprocess; /* the one we're currently working on */
Expand All @@ -151,7 +158,7 @@ void aoecmd_cfg_rsp(struct sk_buff *);

int aoedev_init(void);
void aoedev_exit(void);
struct aoedev *aoedev_bymac(unsigned char *);
struct aoedev *aoedev_by_aoeaddr(int maj, int min);
void aoedev_downdev(struct aoedev *d);
struct aoedev *aoedev_set(ulong, unsigned char *, struct net_device *, ulong);
int aoedev_busy(void);
Expand Down
5 changes: 3 additions & 2 deletions drivers/block/aoe/aoeblk.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ aoeblk_make_request(request_queue_t *q, struct bio *bio)
}
memset(buf, 0, sizeof(*buf));
INIT_LIST_HEAD(&buf->bufs);
buf->start_time = jiffies;
buf->bio = bio;
buf->resid = bio->bi_size;
buf->sector = bio->bi_sector;
Expand All @@ -146,8 +147,8 @@ aoeblk_make_request(request_queue_t *q, struct bio *bio)
list_add_tail(&buf->bufs, &d->bufq);
aoecmd_work(d);

sl = d->skblist;
d->skblist = NULL;
sl = d->sendq_hd;
d->sendq_hd = d->sendq_tl = NULL;

spin_unlock_irqrestore(&d->lock, flags);

Expand Down
Loading

0 comments on commit c3c6619

Please sign in to comment.