Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361716
b: refs/heads/master
c: 8f27d48
h: refs/heads/master
v: v3
  • Loading branch information
Asias He authored and Nicholas Bellinger committed Mar 20, 2013
1 parent 248be46 commit d2f5fe1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 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: f002a24388cc460c8a9be7d446a9871f7c9d52b6
refs/heads/master: 8f27d487bcc2bd603c2d87e1729abcbc301f15db
11 changes: 8 additions & 3 deletions trunk/drivers/target/target_core_pscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,14 @@ pscsi_map_sg(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
pr_debug("PSCSI: i: %d page: %p len: %d off: %d\n", i,
page, len, off);

while (len > 0 && data_len > 0) {
/*
* We only have one page of data in each sg element,
* we can not cross a page boundary.
*/
if (off + len > PAGE_SIZE)
goto fail;

if (len > 0 && data_len > 0) {
bytes = min_t(unsigned int, len, PAGE_SIZE - off);
bytes = min(bytes, data_len);

Expand Down Expand Up @@ -940,9 +947,7 @@ pscsi_map_sg(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
bio = NULL;
}

len -= bytes;
data_len -= bytes;
off = 0;
}
}

Expand Down

0 comments on commit d2f5fe1

Please sign in to comment.