Whamcloud - gitweb
Fix ia64 O_DIRECT crash (bug 1609).
authoradilger <adilger>
Fri, 1 Aug 2003 09:01:35 +0000 (09:01 +0000)
committeradilger <adilger>
Fri, 1 Aug 2003 09:01:35 +0000 (09:01 +0000)
- 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

index 1526295..0885a80 100644 (file)
@@ -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);