"Fossies" - the Fresh Open Source Software Archive

Member "aoe-87/conf/44-patches/old-new.diff" (23 Feb 2017, 3282 Bytes) of package /linux/misc/aoe-87.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Diff source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 commit 4246a0b63bd8f56a1469b12eafeb875b1041a451
    2 Author: Christoph Hellwig <hch@lst.de>
    3 Date:   Mon Jul 20 15:29:37 2015 +0200
    4 
    5     block: add a bi_error field to struct bio
    6     
    7     Currently we have two different ways to signal an I/O error on a BIO:
    8     
    9      (1) by clearing the BIO_UPTODATE flag
   10      (2) by returning a Linux errno value to the bi_end_io callback
   11     
   12     The first one has the drawback of only communicating a single possible
   13     error (-EIO), and the second one has the drawback of not beeing persistent
   14     when bios are queued up, and are not passed along from child to parent
   15     bio in the ever more popular chaining scenario.  Having both mechanisms
   16     available has the additional drawback of utterly confusing driver authors
   17     and introducing bugs where various I/O submitters only deal with one of
   18     them, and the others have to add boilerplate code to deal with both kinds
   19     of error returns.
   20     
   21     So add a new bi_error field to store an errno value directly in struct
   22     bio and remove the existing mechanisms to clean all this up.
   23     
   24     Signed-off-by: Christoph Hellwig <hch@lst.de>
   25     Reviewed-by: Hannes Reinecke <hare@suse.de>
   26     Reviewed-by: NeilBrown <neilb@suse.com>
   27     Signed-off-by: Jens Axboe <axboe@fb.com>
   28 
   29 diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
   30 index 422b7d8..ad80c85 100644
   31 --- a/drivers/block/aoe/aoecmd.c
   32 +++ b/drivers/block/aoe/aoecmd.c
   33 @@ -1110,7 +1110,7 @@ aoe_end_request(struct aoedev *d, struct request *rq, int fastfail)
   34         d->ip.rq = NULL;
   35     do {
   36         bio = rq->bio;
   37 -       bok = !fastfail && test_bit(BIO_UPTODATE, &bio->bi_flags);
   38 +       bok = !fastfail && !bio->bi_error;
   39     } while (__blk_end_request(rq, bok ? 0 : -EIO, bio->bi_iter.bi_size));
   40  
   41     /* cf. http://lkml.org/lkml/2006/10/31/28 */
   42 @@ -1172,7 +1172,7 @@ ktiocomplete(struct frame *f)
   43             ahout->cmdstat, ahin->cmdstat,
   44             d->aoemajor, d->aoeminor);
   45  noskb:     if (buf)
   46 -           clear_bit(BIO_UPTODATE, &buf->bio->bi_flags);
   47 +           buf->bio->bi_error = -EIO;
   48         goto out;
   49     }
   50  
   51 @@ -1185,7 +1185,7 @@ noskb:        if (buf)
   52                 "aoe: runt data size in read from",
   53                 (long) d->aoemajor, d->aoeminor,
   54                    skb->len, n);
   55 -           clear_bit(BIO_UPTODATE, &buf->bio->bi_flags);
   56 +           buf->bio->bi_error = -EIO;
   57             break;
   58         }
   59         if (n > f->iter.bi_size) {
   60 @@ -1193,7 +1193,7 @@ noskb:        if (buf)
   61                 "aoe: too-large data size in read from",
   62                 (long) d->aoemajor, d->aoeminor,
   63                 n, f->iter.bi_size);
   64 -           clear_bit(BIO_UPTODATE, &buf->bio->bi_flags);
   65 +           buf->bio->bi_error = -EIO;
   66             break;
   67         }
   68         bvcpy(skb, f->buf->bio, f->iter, n);
   69 @@ -1695,7 +1695,7 @@ aoe_failbuf(struct aoedev *d, struct buf *buf)
   70     if (buf == NULL)
   71         return;
   72     buf->iter.bi_size = 0;
   73 -   clear_bit(BIO_UPTODATE, &buf->bio->bi_flags);
   74 +   buf->bio->bi_error = -EIO;
   75     if (buf->nframesout == 0)
   76         aoe_end_buf(d, buf);
   77  }
   78 diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c
   79 index e774c50..ffd1947 100644
   80 --- a/drivers/block/aoe/aoedev.c
   81 +++ b/drivers/block/aoe/aoedev.c
   82 @@ -170,7 +170,7 @@ aoe_failip(struct aoedev *d)
   83     if (rq == NULL)
   84         return;
   85     while ((bio = d->ip.nxbio)) {
   86 -       clear_bit(BIO_UPTODATE, &bio->bi_flags);
   87 +       bio->bi_error = -EIO;
   88         d->ip.nxbio = bio->bi_next;
   89         n = (unsigned long) rq->special;
   90         rq->special = (void *) --n;