Whamcloud - gitweb
LU-1693 obdfilter: Set bi_rw before calling bio_add_page()
authorEmoly Liu <emoly.liu@intel.com>
Fri, 7 Dec 2012 06:54:57 +0000 (14:54 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 10 Dec 2012 21:40:46 +0000 (16:40 -0500)
In filter_do_bio() set bi_rw before calling bio_add_page()
so that the correct bio direction is used in mgrge_bvec_fn().

port of master patch 79badd39c6584ae136b14d919eaf699ee812b666

Signed-off-by: John L. Hammond <jhammond@tacc.utexas.edu>
Signed-off-by: Liu Ying <emoly.liu@intel.com>
Change-Id: Ib43a5c198db691f8ed4001c41af7b984a264922b
Reviewed-on: http://review.whamcloud.com/4765
Tested-by: Hudson
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/obdfilter/filter_io_26.c

index eb9a382..05270a1 100644 (file)
@@ -414,6 +414,7 @@ int filter_do_bio(struct obd_export *exp, struct inode *inode,
 
                         bio->bi_bdev = inode->i_sb->s_bdev;
                         bio->bi_sector = sector;
+                        bio->bi_rw = (rw == OBD_BRW_READ ? READ : WRITE);
                         bio->bi_end_io = dio_complete_routine;
                         bio->bi_private = iobuf;