From 069cacdbaeb04b3c8f9ed67a62d88ca85e48d61c Mon Sep 17 00:00:00 2001 From: adilger Date: Fri, 1 Aug 2003 09:01:35 +0000 Subject: [PATCH] Fix ia64 O_DIRECT crash (bug 1609). - 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). --- lustre/obdfilter/filter_io.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lustre/obdfilter/filter_io.c b/lustre/obdfilter/filter_io.c index 1526295..0885a80 100644 --- a/lustre/obdfilter/filter_io.c +++ b/lustre/obdfilter/filter_io.c @@ -202,11 +202,10 @@ int filter_get_page_write(struct inode *inode, struct niobuf_local *lnb, 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); -- 1.8.3.1