lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAFR8uee7XwO0bKcUrGY1N328CwRQAs4Qak1oXUjZdYoeUEhAtA@mail.gmail.com>
Date:	Fri, 8 Jul 2011 19:51:59 -0700
From:	Muthu Kumar <muthu.lkml@...il.com>
To:	linux-kernel@...r.kernel.org, jaxboe@...ionio.com
Subject: [PATCH] block: Initialize bi_rw in mpage so bio_add can make use of it.

Jens et al,

do_mpage_readpage()/__mpage_writepage(): When they allocate a new bio,
bi_rw is not initialized. So later when they call __bio_add_page(),
struct bvec_merge_data bvm's .bi_rw will not be initialized with right
direction.
It will be useful for some merge functions if they know the direction
of transfer.

Let me know if this looks good. There are few more places like this
(e.g blkdev_issue_zeroout()). Would it make sense to send patch for
these cases also?

Signed-off-by: Muthukumar R <muthu.lkml@...il.com>

--------
fs/mpage.c |    2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/fs/mpage.c b/fs/mpage.c
index fdfae9f..c8e0f8a 100644
--- a/fs/mpage.c
+++ b/fs/mpage.c
@@ -293,6 +293,7 @@ alloc_new:
                       goto confused;
       }

+    bio->bi_rw = READ;
       length = first_hole << blkbits;
       if (bio_add_page(bio, page, length, 0) < length) {
               bio = mpage_bio_submit(READ, bio);
@@ -590,6 +591,7 @@ alloc_new:
        * the confused fail path above (OOM) will be very confused when
        * it finds all bh marked clean (i.e. it will not write anything)
        */
+    bio->bi_rw = WRITE;
       length = first_unmapped << blkbits;
       if (bio_add_page(bio, page, length, 0) < length) {
               bio = mpage_bio_submit(WRITE, bio);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ