- don't send less than PAGE_SIZE O_DIRECT writes... It appears that lustre
or the VFS does not handle this properly. This is the only time we send
non-page-aligned writes.
- prepare_write() takes parameters "from" and "to", and not "offset" and "len"
(this is real source of crash - we were not mapping a buffer in this case).
lnb->page = page;
lnb->flags |= N_LOCAL_TEMP_PAGE;
} else if (!IS_ERR(page)) {
+ unsigned from = lnb->offset & ~PAGE_MASK, to = from + lnb->len;
(*pglocked)++;
- rc = mapping->a_ops->prepare_write(NULL, page,
- lnb->offset & ~PAGE_MASK,
- lnb->len);
+ rc = mapping->a_ops->prepare_write(NULL, page, from, to);
if (rc) {
if (rc != -ENOSPC)
CERROR("page index %lu, rc = %d\n", index, rc);