Re: [PATCH v3 4/4] PM: submit bio in a sane way in cases without bio_chain
From: Pavel Machek
Date: Tue May 05 2015 - 05:23:52 EST
On Thu 2015-04-30 18:47:17, Pavel Machek wrote:
> Hi!
>
> > >From af56dde07c34b203f5c40c8864bfd55697b0aad0 Mon Sep 17 00:00:00 2001
> > From: Christoph Hellwig <hch@xxxxxx>
> > Date: Fri, 24 Apr 2015 11:26:00 +0200
> > Subject: suspend: sane block I/O handling
> >
> > stop abusing struct page functionality and the swap end_io handler, and
> > instead add a modified version of the blk-lib.c bio_batch helpers.
> >
> > Also move the block I/O code into swap.c as they are directly tied into
> > each other.
> >
> > Signed-off-by: Christoph Hellwig <hch@xxxxxx>
>
> Tested-by: Pavel Machek <pavel@xxxxxx>
> Acked-by: Pavel Machek <pavel@xxxxxx>
>
> (thinkpad x60 in shutdown mode, platform mode has some problems, but
> they are probably not related).
There seems to be extra trailing whitespace in this function:
+static void hib_end_io(struct bio *bio, int error)
+{
+ struct hib_bio_batch *hb = bio->bi_private;
+ const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
+ struct page *page = bio->bi_io_vec[0].bv_page;
+
+ if (!uptodate || error) {
+ printk(KERN_ALERT "Read-error on swap-device
(%u:%u:%Lu)\n",
+ imajor(bio->bi_bdev->bd_inode),
+ iminor(bio->bi_bdev->bd_inode),
+ (unsigned long
long)bio->bi_iter.bi_sector);
+
+ if (!error)
+ error = -EIO;
+ }
+
+ if (bio_data_dir(bio) == WRITE)
+ put_page(page);
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/