[LU-1883] osd-ldiskfs fills file offsets into lnb->offset fields used as page offsets Created: 11/Sep/12 Updated: 18/Apr/13 Resolved: 19/Oct/12 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.4.0 |
| Fix Version/s: | Lustre 2.4.0 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Li Wei (Inactive) | Assignee: | Li Wei (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | USE_OFD | ||
| Issue Links: |
|
||||||||||||
| Severity: | 3 | ||||||||||||
| Rank (Obsolete): | 3988 | ||||||||||||
| Description |
|
This affects ofd + osd-ldiskfs but not obdfilter or current MDS/MGS stack. static int osd_map_remote_to_local(loff_t offset, ssize_t len, int *nrpages, struct niobuf_local *lnb) { ENTRY; *nrpages = 0; while (len > 0) { int poff = offset & (CFS_PAGE_SIZE - 1); int plen = CFS_PAGE_SIZE - poff; if (plen > len) plen = len; lnb->offset = offset; /* lnb->lnb_page_offset = poff; */ "offset" contains the file offset, while "lnb->offset" is expected to be the page offset: static int osd_write_prep(const struct lu_env *env, struct dt_object *dt, struct niobuf_local *lnb, int npages) { [...] if (maxidx >= lnb[i].page->index) { osd_iobuf_add_page(iobuf, lnb[i].page); } else { long off; char *p = kmap(lnb[i].page); off = lnb[i].offset; if (off) memset(p, 0, off); The memset() call might zero out quite a number of pages that may not belong to Lustre. |
| Comments |
| Comment by Alex Zhuravlev [ 11/Sep/12 ] |
|
the correct fix would be to introduce lnb_page_offset and lnb_file_offset as in orion. |
| Comment by Li Wei (Inactive) [ 11/Sep/12 ] |
|
http://review.whamcloud.com/3940 This is for b2_3. |
| Comment by Mikhail Pershin [ 14/Sep/12 ] |
|
lnb has already lnb_file_offset field in master, so we need just use it as file offset and lnb->offset as page offset. Separate patch would rename other lnb fields to have lnb_ prefix. |
| Comment by Li Wei (Inactive) [ 20/Sep/12 ] |
|
Yes, the patch makes sure lnb_file_offset and lnb_page_offset both store what the names imply. |
| Comment by Li Wei (Inactive) [ 20/Sep/12 ] |
|
http://review.whamcloud.com/4051 This is for master. |
| Comment by Li Wei (Inactive) [ 20/Sep/12 ] |
|
This is actually a blocker for 2.4. I have to remove 2.3.0 from the "affects version/s" list, so that this does not block 2.3. |
| Comment by Li Wei (Inactive) [ 25/Sep/12 ] |
|
The master patch has landed. |
| Comment by Jodi Levi (Inactive) [ 19/Oct/12 ] |
|
Please let me know if this is still an issue and needs to be reopened. |