From d05d70228af64e7155839526d42f37ac97f61ab0 Mon Sep 17 00:00:00 2001 From: phil Date: Sat, 30 Jul 2005 00:05:48 +0000 Subject: [PATCH] b=6266 (oleg's patch) 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 | 8 ++++++++ lustre/liblustre/super.c | 13 ++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 410e796..951dcec 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -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. diff --git a/lustre/liblustre/super.c b/lustre/liblustre/super.c index 212d45d1..76bf207 100644 --- a/lustre/liblustre/super.c +++ b/lustre/liblustre/super.c @@ -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); } -- 1.8.3.1