Whamcloud - gitweb
fix statfs bug and a truncation issue.
authorbraam <braam>
Fri, 19 Oct 2001 05:17:34 +0000 (05:17 +0000)
committerbraam <braam>
Fri, 19 Oct 2001 05:17:34 +0000 (05:17 +0000)
lustre/obdfs/rw.c
lustre/obdfs/super.c

index 218e366..19f1032 100644 (file)
@@ -384,7 +384,8 @@ int obdfs_commit_write(struct file *file, struct page *page, unsigned from, unsi
         int rc;
         struct inode *inode = page->mapping->host;
         loff_t pos = ((loff_t)page->index << PAGE_CACHE_SHIFT) + to;
-        rc = obdfs_writepage(page);
+       // XXX test with synchronous writes
+        rc = obdfs_do_writepage(page, 1);
         kunmap(page);
         if (pos > inode->i_size) {
                 inode->i_size = pos;
index 6332866..faf46bb 100644 (file)
@@ -459,7 +459,6 @@ int obdfs_notify_change(struct dentry *de, struct iattr *attr)
 static int obdfs_statfs(struct super_block *sb, struct statfs *buf)
 {
         struct statfs tmp;
-        int bufsize = sizeof(*buf);
         int err;
 
         ENTRY;
@@ -469,8 +468,8 @@ static int obdfs_statfs(struct super_block *sb, struct statfs *buf)
                 printk(__FUNCTION__ ": obd_statfs fails (%d)\n", err);
                 return err;
         }
-        copy_to_user(buf, &tmp, (bufsize<sizeof(tmp)) ? bufsize : sizeof(tmp));
-
+       memcpy(buf, &tmp, sizeof(*buf));
+       CDEBUG(D_SUPER, "statfs returns avail %ld\n", tmp.f_bavail);
         EXIT;
 
         return err;