Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32933
b: refs/heads/master
c: e4b57e0
h: refs/heads/master
i:
  32931: 3392abc
v: v3
  • Loading branch information
Michal Feix authored and Linus Torvalds committed Jul 31, 2006
1 parent da81444 commit f339e7a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8e185d83398b2708f50207bc12d0e0a70bd70767
refs/heads/master: e4b57e0842621f597d744b193ea325d62724596b
16 changes: 9 additions & 7 deletions trunk/drivers/block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,15 @@ static struct request *nbd_read_stat(struct nbd_device *lo)
lo->disk->disk_name, result);
goto harderror;
}

if (ntohl(reply.magic) != NBD_REPLY_MAGIC) {
printk(KERN_ERR "%s: Wrong magic (0x%lx)\n",
lo->disk->disk_name,
(unsigned long)ntohl(reply.magic));
result = -EPROTO;
goto harderror;
}

req = nbd_find_request(lo, reply.handle);
if (unlikely(IS_ERR(req))) {
result = PTR_ERR(req);
Expand All @@ -312,13 +321,6 @@ static struct request *nbd_read_stat(struct nbd_device *lo)
goto harderror;
}

if (ntohl(reply.magic) != NBD_REPLY_MAGIC) {
printk(KERN_ERR "%s: Wrong magic (0x%lx)\n",
lo->disk->disk_name,
(unsigned long)ntohl(reply.magic));
result = -EPROTO;
goto harderror;
}
if (ntohl(reply.error)) {
printk(KERN_ERR "%s: Other side returned error (%d)\n",
lo->disk->disk_name, ntohl(reply.error));
Expand Down

0 comments on commit f339e7a

Please sign in to comment.