"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "drbd/drbd-kernel-compat/cocci_cache/9496afbec925e602712771721e059086/compat.patch" between
drbd-9.1.10.tar.gz and drbd-9.1.11.tar.gz

About: DRBD (9.x) is a block device which is designed to build high availability clusters. This is done by mirroring a whole block device via (a dedicated) network. You could see it as a "network RAID-1". The driver code got integrated into the vanilla Linux kernel.

compat.patch  (drbd-9.1.10):compat.patch  (drbd-9.1.11)
--- ./drbd_req.h --- ./drbd_req.h
+++ /tmp/cocci-output-401627-baec83-drbd_req.h
@@ -280,7 +280,7 @@ extern void __req_mod(struct drbd_reques @@ -280,7 +280,7 @@ extern void __req_mod(struct drbd_reques
struct bio_and_error *m); struct bio_and_error *m);
extern void complete_master_bio(struct drbd_device *device, extern void complete_master_bio(struct drbd_device *device,
struct bio_and_error *m); struct bio_and_error *m);
-extern void request_timer_fn(struct timer_list *t); -extern void request_timer_fn(struct timer_list *t);
+extern void request_timer_fn(unsigned long data); +extern void request_timer_fn(unsigned long data);
extern void tl_walk(struct drbd_connection *connection, struct drbd_request **f rom_req, enum drbd_req_event what); extern void tl_walk(struct drbd_connection *connection, struct drbd_request **f rom_req, enum drbd_req_event what);
extern void __tl_walk(struct drbd_resource *const resource, extern void __tl_walk(struct drbd_resource *const resource,
struct drbd_connection *const connection, struct drbd_connection *const connection,
--- ./drbd_int.h --- ./drbd_int.h
+++ /tmp/cocci-output-401627-85f4f9-drbd_int.h
@@ -429,7 +429,7 @@ struct drbd_peer_request { @@ -429,7 +429,7 @@ struct drbd_peer_request {
struct list_head wait_for_actlog; struct list_head wait_for_actlog;
struct drbd_page_chain_head page_chain; struct drbd_page_chain_head page_chain;
- unsigned int opf; /* to be used as bi_opf */ - unsigned int opf; /* to be used as bi_opf */
+ unsigned int rw; /* to be used as bi_opf */ + unsigned int rw; /* to be used as bi_opf */
atomic_t pending_bios; atomic_t pending_bios;
struct drbd_interval i; struct drbd_interval i;
unsigned long flags; /* see comments on ee flag bits below */ unsigned long flags; /* see comments on ee flag bits below */
@@ -452,10 +452,6 @@ struct drbd_peer_request { @@ -452,10 +452,6 @@ struct drbd_peer_request {
skipping to change at line 161 skipping to change at line 161
enum write_ordering_e wo); enum write_ordering_e wo);
-extern void twopc_timer_fn(struct timer_list *t); -extern void twopc_timer_fn(struct timer_list *t);
-extern void connect_timer_fn(struct timer_list *t); -extern void connect_timer_fn(struct timer_list *t);
+extern void twopc_timer_fn(unsigned long data); +extern void twopc_timer_fn(unsigned long data);
+extern void connect_timer_fn(unsigned long data); +extern void connect_timer_fn(unsigned long data);
/* drbd_proc.c */ /* drbd_proc.c */
extern struct proc_dir_entry *drbd_proc; extern struct proc_dir_entry *drbd_proc;
--- drbd-headers/linux/genl_magic_struct.h --- drbd-headers/linux/genl_magic_struct.h
+++ /tmp/cocci-output-401627-8eb0c6-genl_magic_struct.h
@@ -107,7 +107,7 @@ static inline int nla_put_u64_0pad(struc @@ -107,7 +107,7 @@ static inline int nla_put_u64_0pad(struc
nla_get_u64, nla_put_u64_0pad, false) nla_get_u64, nla_put_u64_0pad, false)
#define __str_field(attr_nr, attr_flag, name, maxlen) \ #define __str_field(attr_nr, attr_flag, name, maxlen) \
__array(attr_nr, attr_flag, name, NLA_NUL_STRING, char, maxlen, \ __array(attr_nr, attr_flag, name, NLA_NUL_STRING, char, maxlen, \
- nla_strscpy, nla_put, false) - nla_strscpy, nla_put, false)
+ nla_strlcpy, nla_put, false) + nla_strlcpy, nla_put, false)
#define __bin_field(attr_nr, attr_flag, name, maxlen) \ #define __bin_field(attr_nr, attr_flag, name, maxlen) \
__array(attr_nr, attr_flag, name, NLA_BINARY, char, maxlen, \ __array(attr_nr, attr_flag, name, NLA_BINARY, char, maxlen, \
nla_memcpy, nla_put, false) nla_memcpy, nla_put, false)
--- kref_debug.c --- kref_debug.c
+++ /tmp/cocci-output-401627-f0edfd-kref_debug.c
@@ -108,7 +108,7 @@ void print_kref_debug_info(struct seq_fi @@ -108,7 +108,7 @@ void print_kref_debug_info(struct seq_fi
char obj_name[80]; char obj_name[80];
debug_refs = number_of_debug_refs(debug_info); debug_refs = number_of_debug_refs(debug_info);
- refs = refcount_read(&debug_info->kref->refcount); - refs = refcount_read(&debug_info->kref->refcount);
+ refs = atomic_read(&debug_info->kref->refcount); + refs = atomic_read(&debug_info->kref->refcount);
debug_info->class->get_object_name(debug_info, obj_name); debug_info->class->get_object_name(debug_info, obj_name);
seq_printf(seq, "class: %s, name: %s, refs: %d, dr: %d\n", seq_printf(seq, "class: %s, name: %s, refs: %d, dr: %d\n",
--- drbd_transport_tcp.c --- drbd_transport_tcp.c
+++ /tmp/cocci-output-401627-f34365-drbd_transport_tcp.c
@@ -154,6 +154,33 @@ static struct drbd_path *__drbd_next_pat @@ -154,6 +154,33 @@ static struct drbd_path *__drbd_next_pat
return drbd_path; return drbd_path;
} }
+static void dtt_cork(struct socket *socket) +static void dtt_cork(struct socket *socket)
+{ +{
+ int val = 1; + int val = 1;
+ (void)kernel_setsockopt(socket, SOL_TCP, TCP_CORK, (char *)&val, + (void)kernel_setsockopt(socket, SOL_TCP, TCP_CORK, (char *)&val,
+ sizeof(val)); + sizeof(val));
+} +}
skipping to change at line 332 skipping to change at line 332
if (socket->sk->sk_socket) if (socket->sk->sk_socket)
set_bit(SOCK_NOSPACE, &socket->sk->sk_socket->flags); set_bit(SOCK_NOSPACE, &socket->sk->sk_socket->flags);
break; break;
case QUICKACK: case QUICKACK:
- tcp_sock_set_quickack(socket->sk, 2); - tcp_sock_set_quickack(socket->sk, 2);
+ dtt_quickack(socket); + dtt_quickack(socket);
break; break;
default: /* not implemented, but should not trigger error handling */ default: /* not implemented, but should not trigger error handling */
return true; return true;
--- drbd_state.c --- drbd_state.c
+++ /tmp/cocci-output-401627-695673-drbd_state.c
@@ -147,7 +147,7 @@ static bool may_be_up_to_date(struct drb @@ -147,7 +147,7 @@ static bool may_be_up_to_date(struct drb
case D_DISKLESS: case D_DISKLESS:
if (!(peer_md->flags & MDF_PEER_DEVICE_SEEN)) if (!(peer_md->flags & MDF_PEER_DEVICE_SEEN))
continue; continue;
- fallthrough; - fallthrough;
+ ;/* fallthrough */ + ;/* fallthrough */
case D_ATTACHING: case D_ATTACHING:
case D_DETACHING: case D_DETACHING:
case D_FAILED: case D_FAILED:
--- drbd_sender.c --- drbd_sender.c
+++ /tmp/cocci-output-401627-688c54-drbd_sender.c
@@ -22,8 +22,6 @@ @@ -22,8 +22,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/random.h> #include <linux/random.h>
#include <linux/scatterlist.h> #include <linux/scatterlist.h>
-#include <linux/overflow.h> -#include <linux/overflow.h>
-#include <linux/part_stat.h> -#include <linux/part_stat.h>
#include "drbd_int.h" #include "drbd_int.h"
#include "drbd_protocol.h" #include "drbd_protocol.h"
@@ -53,14 +51,14 @@ static unsigned long get_work_bits(const @@ -53,14 +51,14 @@ static unsigned long get_work_bits(const
skipping to change at line 539 skipping to change at line 539
@@ -2777,7 +2776,7 @@ static void re_init_if_first_write(struc @@ -2777,7 +2776,7 @@ static void re_init_if_first_write(struc
connection->send.current_epoch_writes = 0; connection->send.current_epoch_writes = 0;
connection->send.last_sent_barrier_jif = jiffies; connection->send.last_sent_barrier_jif = jiffies;
connection->send.current_dagtag_sector = connection->send.current_dagtag_sector =
- connection->resource->dagtag_sector - ((BIO_MAX_VECS << P AGE_SHIFT) >> 9) - 1; - connection->resource->dagtag_sector - ((BIO_MAX_VECS << P AGE_SHIFT) >> 9) - 1;
+ connection->resource->dagtag_sector - ((BIO_MAX_PAGES << PAGE_SHIFT) >> 9) - 1; + connection->resource->dagtag_sector - ((BIO_MAX_PAGES << PAGE_SHIFT) >> 9) - 1;
} }
} }
--- drbd_req.c --- drbd_req.c
+++ /tmp/cocci-output-401627-0b08ce-drbd_req.c
@@ -20,11 +20,49 @@ @@ -20,11 +20,49 @@
static bool drbd_may_do_local_read(struct drbd_device *device, sector_t sector, int size); static bool drbd_may_do_local_read(struct drbd_device *device, sector_t sector, int size);
+/* ATTENTION: this is a compat implementation of generic_*_io_acct, +/* ATTENTION: this is a compat implementation of generic_*_io_acct,
+ * added by a coccinelle patch. + * added by a coccinelle patch.
+ * it is more likely to be broken than the upstream version is. + * it is more likely to be broken than the upstream version is.
+ */ + */
+static inline void generic_start_io_acct(struct request_queue *q, int rw, +static inline void generic_start_io_acct(struct request_queue *q, int rw,
+ unsigned long sects, + unsigned long sects,
skipping to change at line 664 skipping to change at line 664
ok = 0; ok = 0;
req->local_rq_state &= ~RQ_POSTPONED; req->local_rq_state &= ~RQ_POSTPONED;
} else if (!ok && } else if (!ok &&
- bio_op(req->master_bio) == REQ_OP_READ && - bio_op(req->master_bio) == REQ_OP_READ &&
- !(req->master_bio->bi_opf & REQ_RAHEAD) && - !(req->master_bio->bi_opf & REQ_RAHEAD) &&
+ !(req->master_bio->bi_rw & REQ_WRITE) && + !(req->master_bio->bi_rw & REQ_WRITE) &&
+ !(req->master_bio->bi_rw & REQ_RAHEAD) && + !(req->master_bio->bi_rw & REQ_RAHEAD) &&
!list_empty(&req->tl_requests)) { !list_empty(&req->tl_requests)) {
/* If READ failed, /* If READ failed,
* have it be pushed back to the retry work queue, * have it be pushed back to the retry work queue,
@@ -965,7 +1003,7 @@ void __req_mod(struct drbd_request *req, @@ -974,7 +1012,7 @@ void __req_mod(struct drbd_request *req,
case READ_COMPLETED_WITH_ERROR: case READ_COMPLETED_WITH_ERROR:
drbd_set_all_out_of_sync(device, req->i.sector, req->i.size); drbd_set_all_out_of_sync(device, req->i.sector, req->i.size);
drbd_report_io_error(device, req); drbd_report_io_error(device, req);
- fallthrough; - fallthrough;
+ ;/* fallthrough */ + ;/* fallthrough */
case READ_AHEAD_COMPLETED_WITH_ERROR: case READ_AHEAD_COMPLETED_WITH_ERROR:
mod_rq_state(req, m, peer_device, RQ_LOCAL_PENDING, RQ_LOCAL_COMP LETED); mod_rq_state(req, m, peer_device, RQ_LOCAL_PENDING, RQ_LOCAL_COMP LETED);
break; break;
@@ -1267,7 +1305,7 @@ static bool remote_due_to_read_balancing @@ -1276,7 +1314,7 @@ static bool remote_due_to_read_balancing
switch (rbm) { switch (rbm) {
case RB_CONGESTED_REMOTE: case RB_CONGESTED_REMOTE:
return bdi_read_congested( return bdi_read_congested(
- device->ldev->backing_bdev->bd_disk->bdi); - device->ldev->backing_bdev->bd_disk->bdi);
+ &device->ldev->backing_bdev->bd_disk->queue->backing_dev_ info); + &device->ldev->backing_bdev->bd_disk->queue->backing_dev_ info);
case RB_LEAST_PENDING: case RB_LEAST_PENDING:
return atomic_read(&device->local_cnt) > return atomic_read(&device->local_cnt) >
atomic_read(&peer_device->ap_pending_cnt) + atomic_read(& peer_device->rs_pending_cnt); atomic_read(&peer_device->ap_pending_cnt) + atomic_read(& peer_device->rs_pending_cnt);
@@ -1608,9 +1646,7 @@ static void drbd_process_discard_or_zero @@ -1617,9 +1655,7 @@ static void drbd_process_discard_or_zero
{ {
int err = drbd_issue_discard_or_zero_out(req->device, int err = drbd_issue_discard_or_zero_out(req->device,
req->i.sector, req->i.size >> 9, flags); req->i.sector, req->i.size >> 9, flags);
- if (err) - if (err)
- req->private_bio->bi_status = BLK_STS_IOERR; - req->private_bio->bi_status = BLK_STS_IOERR;
- bio_endio(req->private_bio); - bio_endio(req->private_bio);
+ bio_endio(req->private_bio, -EIO); + bio_endio(req->private_bio, -EIO);
} }
static void static void
@@ -1620,14 +1656,14 @@ drbd_submit_req_private_bio(struct drbd_ @@ -1629,14 +1665,14 @@ drbd_submit_req_private_bio(struct drbd_
struct bio *bio = req->private_bio; struct bio *bio = req->private_bio;
unsigned int type; unsigned int type;
- if (bio_op(bio) != REQ_OP_READ) - if (bio_op(bio) != REQ_OP_READ)
+ if ((bio->bi_rw & REQ_WRITE)) + if ((bio->bi_rw & REQ_WRITE))
type = DRBD_FAULT_DT_WR; type = DRBD_FAULT_DT_WR;
- else if (bio->bi_opf & REQ_RAHEAD) - else if (bio->bi_opf & REQ_RAHEAD)
+ else if (bio->bi_rw & REQ_RAHEAD) + else if (bio->bi_rw & REQ_RAHEAD)
type = DRBD_FAULT_DT_RA; type = DRBD_FAULT_DT_RA;
else else
type = DRBD_FAULT_DT_RD; type = DRBD_FAULT_DT_RD;
- bio_set_dev(bio, device->ldev->backing_bdev); - bio_set_dev(bio, device->ldev->backing_bdev);
+ bio->bi_bdev = device->ldev->backing_bdev; + bio->bi_bdev = device->ldev->backing_bdev;
/* State may have changed since we grabbed our reference on the /* State may have changed since we grabbed our reference on the
* device->ldev member. Double check, and short-circuit to endio. * device->ldev member. Double check, and short-circuit to endio.
@@ -1636,20 +1672,18 @@ drbd_submit_req_private_bio(struct drbd_ @@ -1645,20 +1681,18 @@ drbd_submit_req_private_bio(struct drbd_
* this bio. */ * this bio. */
if (get_ldev(device)) { if (get_ldev(device)) {
if (drbd_insert_fault(device, type)) { if (drbd_insert_fault(device, type)) {
- bio->bi_status = BLK_STS_IOERR; - bio->bi_status = BLK_STS_IOERR;
- bio_endio(bio); - bio_endio(bio);
- } else if (bio_op(bio) == REQ_OP_WRITE_ZEROES) { - } else if (bio_op(bio) == REQ_OP_WRITE_ZEROES) {
+ bio_endio(bio, -EIO); + bio_endio(bio, -EIO);
+ } else if ((false)/* WRITE_ZEROES not supported on this kernel */ ) { + } else if ((false)/* WRITE_ZEROES not supported on this kernel */ ) {
drbd_process_discard_or_zeroes_req(req, EE_ZEROOUT | drbd_process_discard_or_zeroes_req(req, EE_ZEROOUT |
- ((bio->bi_opf & REQ_NOUNMAP) ? 0 : EE_TRIM)); - ((bio->bi_opf & REQ_NOUNMAP) ? 0 : EE_TRIM));
skipping to change at line 738 skipping to change at line 738
+ generic_make_request(bio); + generic_make_request(bio);
} }
put_ldev(device); put_ldev(device);
} else { } else {
- bio->bi_status = BLK_STS_IOERR; - bio->bi_status = BLK_STS_IOERR;
- bio_endio(bio); - bio_endio(bio);
+ bio_endio(bio, -EIO); + bio_endio(bio, -EIO);
} }
} }
@@ -1699,16 +1733,18 @@ drbd_request_prepare(struct drbd_device @@ -1708,16 +1742,18 @@ drbd_request_prepare(struct drbd_device
/* only pass the error to the upper layers. /* only pass the error to the upper layers.
* if user cannot handle io errors, that's not our business. */ * if user cannot handle io errors, that's not our business. */
drbd_err(device, "could not kmalloc() req\n"); drbd_err(device, "could not kmalloc() req\n");
- bio->bi_status = BLK_STS_RESOURCE; - bio->bi_status = BLK_STS_RESOURCE;
- bio_endio(bio); - bio_endio(bio);
+ bio_endio(bio, -ENOMEM); + bio_endio(bio, -ENOMEM);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
} }
/* Update disk stats */ /* Update disk stats */
skipping to change at line 761 skipping to change at line 761
+ generic_start_io_acct(req->device->rq_queue, + generic_start_io_acct(req->device->rq_queue,
+ bio_data_dir(req->master_bio), req->i.size >> 9, + bio_data_dir(req->master_bio), req->i.size >> 9,
+ &req->device->vdisk->part0); + &req->device->vdisk->part0);
if (get_ldev(device)) { if (get_ldev(device)) {
- req->private_bio = bio_clone_fast(bio, GFP_NOIO, &drbd_io_bio_se t); - req->private_bio = bio_clone_fast(bio, GFP_NOIO, &drbd_io_bio_se t);
+ req->private_bio = bio_clone(bio, GFP_NOIO); + req->private_bio = bio_clone(bio, GFP_NOIO);
req->private_bio->bi_private = req; req->private_bio->bi_private = req;
req->private_bio->bi_end_io = drbd_request_endio; req->private_bio->bi_end_io = drbd_request_endio;
} }
@@ -1729,8 +1765,8 @@ drbd_request_prepare(struct drbd_device @@ -1738,8 +1774,8 @@ drbd_request_prepare(struct drbd_device
atomic_add(interval_to_al_extents(&req->i), &device->wait_for_act log_ecnt); atomic_add(interval_to_al_extents(&req->i), &device->wait_for_act log_ecnt);
/* process discards always from our submitter thread */ /* process discards always from our submitter thread */
- if ((bio_op(bio) == REQ_OP_WRITE_ZEROES) || - if ((bio_op(bio) == REQ_OP_WRITE_ZEROES) ||
- (bio_op(bio) == REQ_OP_DISCARD)) - (bio_op(bio) == REQ_OP_DISCARD))
+ if ((false)/* WRITE_ZEROES not supported on this kernel */ || + if ((false)/* WRITE_ZEROES not supported on this kernel */ ||
+ (bio->bi_rw & REQ_DISCARD)) + (bio->bi_rw & REQ_DISCARD))
goto queue_for_submitter_thread; goto queue_for_submitter_thread;
if (req->private_bio && !test_bit(AL_SUSPENDED, &device->flags)) { if (req->private_bio && !test_bit(AL_SUSPENDED, &device->flags)) {
@@ -1919,7 +1955,7 @@ static void drbd_send_and_submit(struct @@ -1928,7 +1964,7 @@ static void drbd_send_and_submit(struct
* P_BARRIER packet. */ * P_BARRIER packet. */
if (unlikely(req->i.size == 0)) { if (unlikely(req->i.size == 0)) {
/* The only size==0 bios we expect are empty flushes. */ /* The only size==0 bios we expect are empty flushes. */
- D_ASSERT(device, req->master_bio->bi_opf & REQ_PREFLUSH); - D_ASSERT(device, req->master_bio->bi_opf & REQ_PREFLUSH);
+ D_ASSERT(device, req->master_bio->bi_rw & REQ_FLUSH); + D_ASSERT(device, req->master_bio->bi_rw & REQ_FLUSH);
if (!drbd_process_empty_flush(req)) if (!drbd_process_empty_flush(req))
no_remote = true; no_remote = true;
@@ -2265,6 +2301,39 @@ static bool grab_new_incoming_requests(s @@ -2274,6 +2310,39 @@ static bool grab_new_incoming_requests(s
return found_new; return found_new;
} }
+/* This is called by bio_add_page(). +/* This is called by bio_add_page().
+ * + *
+ * q->max_hw_sectors and other global limits are already enforced there. + * q->max_hw_sectors and other global limits are already enforced there.
+ * + *
+ * We need to call down to our lower level device, + * We need to call down to our lower level device,
+ * in case it has special restrictions. + * in case it has special restrictions.
+ * + *
skipping to change at line 821 skipping to change at line 821
+ put_ldev(device); + put_ldev(device);
+ if ((limit >> 9) > max_hw_sectors) + if ((limit >> 9) > max_hw_sectors)
+ limit = max_hw_sectors << 9; + limit = max_hw_sectors << 9;
+ } + }
+ return limit; + return limit;
+} +}
+ +
void do_submit(struct work_struct *ws) void do_submit(struct work_struct *ws)
{ {
struct drbd_device *device = container_of(ws, struct drbd_device, submit. worker); struct drbd_device *device = container_of(ws, struct drbd_device, submit. worker);
@@ -2396,7 +2465,7 @@ static bool drbd_fail_request_early(stru @@ -2405,7 +2474,7 @@ static bool drbd_fail_request_early(stru
return false; return false;
} }
-void drbd_submit_bio(struct bio *bio) -void drbd_submit_bio(struct bio *bio)
+void drbd_make_request(struct request_queue *q, struct bio *bio) +void drbd_make_request(struct request_queue *q, struct bio *bio)
{ {
struct drbd_device *device = bio->bi_bdev->bd_disk->private_data; struct drbd_device *device = bio->bi_bdev->bd_disk->private_data;
#ifdef CONFIG_DRBD_TIMING_STATS #ifdef CONFIG_DRBD_TIMING_STATS
@@ -2405,16 +2474,12 @@ void drbd_submit_bio(struct bio *bio) @@ -2414,16 +2483,12 @@ void drbd_submit_bio(struct bio *bio)
unsigned long start_jif; unsigned long start_jif;
if (drbd_fail_request_early(device, bio)) { if (drbd_fail_request_early(device, bio)) {
- bio->bi_status = BLK_STS_IOERR; - bio->bi_status = BLK_STS_IOERR;
- bio_endio(bio); - bio_endio(bio);
+ bio_endio(bio, -EIO); + bio_endio(bio, -EIO);
return; return;
} }
- blk_queue_split(&bio); - blk_queue_split(&bio);
- -
if (device->cached_err_io) { if (device->cached_err_io) {
- bio->bi_status = BLK_STS_IOERR; - bio->bi_status = BLK_STS_IOERR;
- bio_endio(bio); - bio_endio(bio);
+ bio_endio(bio, -EIO); + bio_endio(bio, -EIO);
return; return;
} }
@@ -2424,9 +2489,9 @@ void drbd_submit_bio(struct bio *bio) @@ -2433,9 +2498,9 @@ void drbd_submit_bio(struct bio *bio)
* Actually don't do anything for size zero bios. * Actually don't do anything for size zero bios.
* Add a "WARN_ONCE", so we can tell the caller to stop doing this. * Add a "WARN_ONCE", so we can tell the caller to stop doing this.
*/ */
- if (bio_op(bio) == REQ_OP_READ && bio->bi_iter.bi_size == 0) { - if (bio_op(bio) == REQ_OP_READ && bio->bi_iter.bi_size == 0) {
+ if (!(bio->bi_rw & REQ_WRITE) && bio->bi_size == 0) { + if (!(bio->bi_rw & REQ_WRITE) && bio->bi_size == 0) {
WARN_ONCE(1, "size zero read from upper layers"); WARN_ONCE(1, "size zero read from upper layers");
- bio_endio(bio); - bio_endio(bio);
+ bio_endio(bio, 0/* COMPLETE AS SUCCESS */); + bio_endio(bio, 0/* COMPLETE AS SUCCESS */);
return; return;
} }
@@ -2434,6 +2499,7 @@ void drbd_submit_bio(struct bio *bio) @@ -2443,6 +2508,7 @@ void drbd_submit_bio(struct bio *bio)
start_jif = jiffies; start_jif = jiffies;
__drbd_make_request(device, bio, start_kt, start_jif); __drbd_make_request(device, bio, start_kt, start_jif);
+ return; + return;
} }
static unsigned long time_min_in_future(unsigned long now, static unsigned long time_min_in_future(unsigned long now,
@@ -2541,9 +2607,9 @@ static bool net_timeout_reached(struct d @@ -2550,9 +2616,9 @@ static bool net_timeout_reached(struct d
* to expire twice (worst case) to become effective. Good enough. * to expire twice (worst case) to become effective. Good enough.
*/ */
-void request_timer_fn(struct timer_list *t) -void request_timer_fn(struct timer_list *t)
+void request_timer_fn(unsigned long data) +void request_timer_fn(unsigned long data)
{ {
- struct drbd_device *device = from_timer(device, t, request_timer); - struct drbd_device *device = from_timer(device, t, request_timer);
+ struct drbd_device *device = (struct drbd_device *)data; + struct drbd_device *device = (struct drbd_device *)data;
struct drbd_resource *resource = device->resource; struct drbd_resource *resource = device->resource;
struct drbd_connection *connection; struct drbd_connection *connection;
struct drbd_request *req_read, *req_write; struct drbd_request *req_read, *req_write;
@@ -2709,7 +2775,7 @@ void drbd_handle_io_error_(struct drbd_d @@ -2718,7 +2784,7 @@ void drbd_handle_io_error_(struct drbd_d
} }
break; break;
} }
- fallthrough; /* for DRBD_META_IO_ERROR or DRBD_FORCE_DETACH */ - fallthrough; /* for DRBD_META_IO_ERROR or DRBD_FORCE_DETACH */
+ ;/* fallthrough */ /* for DRBD_META_IO_ERROR or DRBD_FORCE_D ETACH */ + ;/* fallthrough */ /* for DRBD_META_IO_ERROR or DRBD_FORCE_D ETACH */
case EP_DETACH: case EP_DETACH:
case EP_CALL_HELPER: case EP_CALL_HELPER:
/* Force-detach is not really an IO error, but rather a /* Force-detach is not really an IO error, but rather a
--- drbd_receiver.c --- drbd_receiver.c
+++ /tmp/cocci-output-401627-1a84a8-drbd_receiver.c
@@ -32,7 +32,6 @@ @@ -32,7 +32,6 @@
#include <linux/random.h> #include <linux/random.h>
#include <net/ipv6.h> #include <net/ipv6.h>
#include <linux/scatterlist.h> #include <linux/scatterlist.h>
-#include <linux/part_stat.h> -#include <linux/part_stat.h>
#include "drbd_int.h" #include "drbd_int.h"
#include "drbd_protocol.h" #include "drbd_protocol.h"
@@ -577,7 +576,7 @@ drbd_alloc_peer_req(struct drbd_peer_dev @@ -577,7 +576,7 @@ drbd_alloc_peer_req(struct drbd_peer_dev
if (drbd_insert_fault(device, DRBD_FAULT_AL_EE)) if (drbd_insert_fault(device, DRBD_FAULT_AL_EE))
skipping to change at line 1325 skipping to change at line 1325
+ int ____rv2; + int ____rv2;
+ ____rv2 = sched_setscheduler(current, SCHED_RR, &param); + ____rv2 = sched_setscheduler(current, SCHED_RR, &param);
+ if (____rv2 < 0) + if (____rv2 < 0)
+ drbd_err(connection, + drbd_err(connection,
+ "drbd_ack_receiver: ERROR set priority, ret=%d\n", + "drbd_ack_receiver: ERROR set priority, ret=%d\n",
+ ____rv2); + ____rv2);
while (get_t_state(thi) == RUNNING) { while (get_t_state(thi) == RUNNING) {
drbd_thread_current_set_cpu(thi); drbd_thread_current_set_cpu(thi);
--- drbd_nl.c --- drbd_nl.c
+++ /tmp/cocci-output-401627-05c7c9-drbd_nl.c
@@ -114,7 +114,7 @@ static int drbd_msg_put_info(struct sk_b @@ -114,7 +114,7 @@ static int drbd_msg_put_info(struct sk_b
if (!info || !info[0]) if (!info || !info[0])
return 0; return 0;
- nla = nla_nest_start_noflag(skb, DRBD_NLA_CFG_REPLY); - nla = nla_nest_start_noflag(skb, DRBD_NLA_CFG_REPLY);
+ nla = nla_nest_start(skb, DRBD_NLA_CFG_REPLY); + nla = nla_nest_start(skb, DRBD_NLA_CFG_REPLY);
if (!nla) if (!nla)
return err; return err;
@@ -141,7 +141,7 @@ static int drbd_msg_sprintf_info(struct @@ -141,7 +141,7 @@ static int drbd_msg_sprintf_info(struct
skipping to change at line 1493 skipping to change at line 1493
@@ -5641,7 +5647,7 @@ int drbd_adm_dump_connections_done(struc @@ -5641,7 +5647,7 @@ int drbd_adm_dump_connections_done(struc
static int connection_paths_to_skb(struct sk_buff *skb, struct drbd_connection *connection) static int connection_paths_to_skb(struct sk_buff *skb, struct drbd_connection *connection)
{ {
struct drbd_path *path; struct drbd_path *path;
- struct nlattr *tla = nla_nest_start_noflag(skb, DRBD_NLA_PATH_PARMS); - struct nlattr *tla = nla_nest_start_noflag(skb, DRBD_NLA_PATH_PARMS);
+ struct nlattr *tla = nla_nest_start(skb, DRBD_NLA_PATH_PARMS); + struct nlattr *tla = nla_nest_start(skb, DRBD_NLA_PATH_PARMS);
if (!tla) if (!tla)
goto nla_put_failure; goto nla_put_failure;
--- drbd_nla.c --- drbd_nla.c
+++ /tmp/cocci-output-401627-59c947-drbd_nla.c
@@ -35,8 +35,7 @@ int drbd_nla_parse_nested(struct nlattr @@ -35,8 +35,7 @@ int drbd_nla_parse_nested(struct nlattr
err = drbd_nla_check_mandatory(maxtype, nla); err = drbd_nla_check_mandatory(maxtype, nla);
if (!err) if (!err)
- err = nla_parse_nested_deprecated(tb, maxtype, nla, policy, - err = nla_parse_nested_deprecated(tb, maxtype, nla, policy,
- NULL); - NULL);
+ err = nla_parse_nested(tb, maxtype, nla, policy, NULL); + err = nla_parse_nested(tb, maxtype, nla, policy, NULL);
return err; return err;
} }
--- drbd_main.c --- drbd_main.c
+++ /tmp/cocci-output-401627-f82a7f-drbd_main.c
@@ -54,7 +54,7 @@ @@ -54,7 +54,7 @@
static int drbd_open(struct block_device *bdev, fmode_t mode); static int drbd_open(struct block_device *bdev, fmode_t mode);
static void drbd_release(struct gendisk *gd, fmode_t mode); static void drbd_release(struct gendisk *gd, fmode_t mode);
-static void md_sync_timer_fn(struct timer_list *t); -static void md_sync_timer_fn(struct timer_list *t);
+static void md_sync_timer_fn(unsigned long data); +static void md_sync_timer_fn(unsigned long data);
static int w_bitmap_io(struct drbd_work *w, int unused); static int w_bitmap_io(struct drbd_work *w, int unused);
static int flush_send_buffer(struct drbd_connection *connection, enum drbd_stre am drbd_stream); static int flush_send_buffer(struct drbd_connection *connection, enum drbd_stre am drbd_stream);
static u64 __set_bitmap_slots(struct drbd_device *device, u64 bitmap_uuid, u64 do_nodes) __must_hold(local); static u64 __set_bitmap_slots(struct drbd_device *device, u64 bitmap_uuid, u64 do_nodes) __must_hold(local);
@@ -70,6 +70,7 @@ MODULE_PARM_DESC(minor_count, "Approxima @@ -70,6 +70,7 @@ MODULE_PARM_DESC(minor_count, "Approxima
skipping to change at line 2070 skipping to change at line 2070
-static void md_sync_timer_fn(struct timer_list *t) -static void md_sync_timer_fn(struct timer_list *t)
+static void md_sync_timer_fn(unsigned long data) +static void md_sync_timer_fn(unsigned long data)
{ {
- struct drbd_device *device = from_timer(device, t, md_sync_timer); - struct drbd_device *device = from_timer(device, t, md_sync_timer);
+ struct drbd_device *device = (struct drbd_device *)data; + struct drbd_device *device = (struct drbd_device *)data;
drbd_device_post_work(device, MD_SYNC); drbd_device_post_work(device, MD_SYNC);
} }
--- drbd_interval.c --- drbd_interval.c
+++ /tmp/cocci-output-401627-6e9763-drbd_interval.c
@@ -13,10 +13,32 @@ sector_t interval_end(struct rb_node *no @@ -13,10 +13,32 @@ sector_t interval_end(struct rb_node *no
return this->end; return this->end;
} }
-#define NODE_END(node) ((node)->sector + ((node)->size >> 9)) -#define NODE_END(node) ((node)->sector + ((node)->size >> 9))
+/** +/**
+ * compute_subtree_last - compute end of @node + * compute_subtree_last - compute end of @node
+ * + *
+ * The end of an interval is the highest (start + (size >> 9)) value of this + * The end of an interval is the highest (start + (size >> 9)) value of this
+ * node and of its children. Called for @node and its parents whenever the end + * node and of its children. Called for @node and its parents whenever the end
skipping to change at line 2108 skipping to change at line 2108
+} +}
#define _STATIC static #define _STATIC static
-RB_DECLARE_CALLBACKS_MAX(_STATIC, augment_callbacks, struct drbd_interval, rb, -RB_DECLARE_CALLBACKS_MAX(_STATIC, augment_callbacks, struct drbd_interval, rb,
- sector_t, end, NODE_END); - sector_t, end, NODE_END);
+RB_DECLARE_CALLBACKS(_STATIC, augment_callbacks, struct drbd_interval, rb, +RB_DECLARE_CALLBACKS(_STATIC, augment_callbacks, struct drbd_interval, rb,
+ sector_t, end, compute_subtree_last); + sector_t, end, compute_subtree_last);
/* /*
* drbd_insert_interval - insert a new interval into a tree * drbd_insert_interval - insert a new interval into a tree
--- drbd_debugfs.c --- drbd_debugfs.c
+++ /tmp/cocci-output-401627-5e3f43-drbd_debugfs.c
@@ -604,12 +604,12 @@ static int drbd_single_open(struct file @@ -604,12 +604,12 @@ static int drbd_single_open(struct file
if (!parent || !parent->d_inode) if (!parent || !parent->d_inode)
goto out; goto out;
/* serialize with d_delete() */ /* serialize with d_delete() */
- inode_lock(d_inode(parent)); - inode_lock(d_inode(parent));
+ mutex_lock(&parent->d_inode->i_mutex); + mutex_lock(&parent->d_inode->i_mutex);
/* Make sure the object is still alive */ /* Make sure the object is still alive */
if (simple_positive(file->f_path.dentry) if (simple_positive(file->f_path.dentry)
&& kref_get_unless_zero(kref)) && kref_get_unless_zero(kref))
ret = 0; ret = 0;
skipping to change at line 2232 skipping to change at line 2232
+ seq_puts(m, "gendisk_part0__no_is_block_device\n"); + seq_puts(m, "gendisk_part0__no_is_block_device\n");
+ seq_puts(m, "bio_max_vecs__no_present\n"); + seq_puts(m, "bio_max_vecs__no_present\n");
+ seq_puts(m, "fs_dax_get_by_bdev__no_present\n"); + seq_puts(m, "fs_dax_get_by_bdev__no_present\n");
+ seq_puts(m, "add_disk__no_returns_int\n"); + seq_puts(m, "add_disk__no_returns_int\n");
+ seq_puts(m, "bdev_nr_sectors__no_present\n"); + seq_puts(m, "bdev_nr_sectors__no_present\n");
+ seq_puts(m, "genhd_fl_no_part__no_present\n"); + seq_puts(m, "genhd_fl_no_part__no_present\n");
return 0; return 0;
} }
--- drbd_dax_pmem.c --- drbd_dax_pmem.c
+++ /tmp/cocci-output-401627-46a3b2-drbd_dax_pmem.c
@@ -58,9 +58,9 @@ int drbd_dax_open(struct drbd_backing_de @@ -58,9 +58,9 @@ int drbd_dax_open(struct drbd_backing_de
{ {
struct dax_device *dax_dev; struct dax_device *dax_dev;
int err; int err;
- u64 part_off; - u64 part_off;
- -
- dax_dev = fs_dax_get_by_bdev(bdev->md_bdev, &part_off); - dax_dev = fs_dax_get_by_bdev(bdev->md_bdev, &part_off);
+ if (!blk_queue_dax(bdev->md_bdev->bd_queue)) + if (!blk_queue_dax(bdev->md_bdev->bd_queue))
+ return -ENODEV; + return -ENODEV;
+ dax_dev = fs_dax_get_by_host(bdev->md_bdev->bd_disk->disk_name); + dax_dev = fs_dax_get_by_host(bdev->md_bdev->bd_disk->disk_name);
if (!dax_dev) if (!dax_dev)
return -ENODEV; return -ENODEV;
--- drbd_bitmap.c --- drbd_bitmap.c
+++ /tmp/cocci-output-401627-953980-drbd_bitmap.c
@@ -365,7 +365,8 @@ static struct page **bm_realloc_pages(st @@ -365,7 +365,8 @@ static struct page **bm_realloc_pages(st
new_pages = kzalloc(bytes, GFP_NOIO | __GFP_NOWARN); new_pages = kzalloc(bytes, GFP_NOIO | __GFP_NOWARN);
if (!new_pages) { if (!new_pages) {
new_pages = __vmalloc(bytes, new_pages = __vmalloc(bytes,
- GFP_NOIO | __GFP_HIGHMEM | __GFP_ZERO); - GFP_NOIO | __GFP_HIGHMEM | __GFP_ZERO);
+ GFP_NOIO | __GFP_HIGHMEM | __GFP_ZERO, + GFP_NOIO | __GFP_HIGHMEM | __GFP_ZERO,
+ PAGE_KERNEL); + PAGE_KERNEL);
if (!new_pages) if (!new_pages)
return NULL; return NULL;
} }
skipping to change at line 2342 skipping to change at line 2342
+ bio_endio(bio, -EIO); + bio_endio(bio, -EIO);
} else { } else {
- submit_bio(bio); - submit_bio(bio);
- if (op == REQ_OP_WRITE) - if (op == REQ_OP_WRITE)
+ submit_bio(rw, bio); + submit_bio(rw, bio);
+ if ((rw & REQ_WRITE)) + if ((rw & REQ_WRITE))
device->bm_writ_cnt++; device->bm_writ_cnt++;
/* this should not count as user activity and cause the /* this should not count as user activity and cause the
* resync to throttle -- see drbd_rs_should_slow_down(). */ * resync to throttle -- see drbd_rs_should_slow_down(). */
--- drbd_actlog.c --- drbd_actlog.c
+++ /tmp/cocci-output-401627-57eddc-drbd_actlog.c
@@ -80,30 +80,31 @@ void wait_until_done_or_force_detached(s @@ -80,30 +80,31 @@ void wait_until_done_or_force_detached(s
static int _drbd_md_sync_page_io(struct drbd_device *device, static int _drbd_md_sync_page_io(struct drbd_device *device,
struct drbd_backing_dev *bdev, struct drbd_backing_dev *bdev,
- sector_t sector, int op) - sector_t sector, int op)
+ sector_t sector, int rw) + sector_t sector, int rw)
{ {
struct bio *bio; struct bio *bio;
/* we do all our meta data IO in aligned 4k blocks. */ /* we do all our meta data IO in aligned 4k blocks. */
const int size = 4096; const int size = 4096;
 End of changes. 32 change blocks. 
32 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)