cgroup: fix cgroup_path() vs rename() race
[linux-3.10.git] / block / blk-map.c
index 164cd00..623e1cd 100644 (file)
@@ -311,7 +311,7 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf,
        if (IS_ERR(bio))
                return PTR_ERR(bio);
 
-       if (rq_data_dir(rq) == WRITE)
+       if (!reading)
                bio->bi_rw |= REQ_WRITE;
 
        if (do_copy)