Whamcloud - gitweb
b=6266 (oleg's patch)
authorphil <phil>
Sat, 30 Jul 2005 00:05:48 +0000 (00:05 +0000)
committerphil <phil>
Sat, 30 Jul 2005 00:05:48 +0000 (00:05 +0000)
Severity   : minor
Bugzilla   : 6266
Frequency  : rare (liblustre)
Description: fsx running with liblustre complained that using truncate() to
             extend the file doesn't work.  This patch corrects that issue.
Details    : This is the liblustre equivalent of the fix for bug 6196.  Fixes
             ATTR_SIZE and lsm use in llu_setattr_raw.

lustre/ChangeLog
lustre/liblustre/super.c

index 410e796..951dcec 100644 (file)
@@ -54,6 +54,14 @@ Details    : The config llog parsing code may overwrite the error return
              code during mount error handling, returning success instead
              of an error.
 
+Severity   : minor
+Bugzilla   : 6266
+Frequency  : rare (liblustre)
+Description: fsx running with liblustre complained that using truncate() to
+             extend the file doesn't work.  This patch corrects that issue.
+Details    : This is the liblustre equivalent of the fix for bug 6196.  Fixes
+             ATTR_SIZE and lsm use in llu_setattr_raw.
+
 ------------------------------------------------------------------------------
 
 2005-07-07  Cluster File Systems, Inc. <info@clusterfs.com>
index 212d45d..76bf207 100644 (file)
@@ -685,17 +685,16 @@ int llu_setattr_raw(struct inode *inode, struct iattr *attr)
                         RETURN(rc);
                 }
 
-                /* We call inode_setattr to adjust timestamps, but we first
-                 * clear ATTR_SIZE to avoid invoking vmtruncate.
-                 *
-                 * NB: ATTR_SIZE will only be set at this point if the size
-                 * resides on the MDS, ie, this file has no objects. */
-                attr->ia_valid &= ~ATTR_SIZE;
+                /* We call inode_setattr to adjust timestamps.
+                 * If there is at least some data in file, we cleared ATTR_SIZE
+                 * above to avoid invoking vmtruncate, otherwise it is important
+                 * to call vmtruncate in inode_setattr to update inode->i_size
+                 * (bug 6196) */
                 inode_setattr(inode, attr);
                 llu_update_inode(inode, md.body, md.lsm);
                 ptlrpc_req_finished(request);
 
-                if (!md.lsm || !S_ISREG(st->st_mode)) {
+                if (!lsm || !S_ISREG(st->st_mode)) {
                         CDEBUG(D_INODE, "no lsm: not setting attrs on OST\n");
                         RETURN(0);
                 }