Commit 251c4317 authored by John L. Hammond's avatar John L. Hammond Committed by Greg Kroah-Hartman

staging/lustre/llite: call simple_setattr() from ll_md_setattr()

This partially reverts the change from "LU-2482 layout: introduce new
layout for released files" by calling simple_setattr() from
ll_md_setattr() without ATTR_SIZE set. Doing so avoids failed
assertions in osc_page_delete(). Disable truncates on released files
and modify sanity 229 accordingly.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3448
Lustre-change: http://review.whamcloud.com/6643Signed-off-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-by: default avatarjacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Reviewed-by: default avatarJinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarPeng Tao <tao.peng@emc.com>
Signed-off-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ce74f92d
...@@ -1282,6 +1282,13 @@ int ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data, ...@@ -1282,6 +1282,13 @@ int ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data,
RETURN(rc); RETURN(rc);
} }
ia_valid = op_data->op_attr.ia_valid;
/* inode size will be in ll_setattr_ost, can't do it now since dirty
* cache is not cleared yet. */
op_data->op_attr.ia_valid &= ~(TIMES_SET_FLAGS | ATTR_SIZE);
rc = simple_setattr(dentry, &op_data->op_attr);
op_data->op_attr.ia_valid = ia_valid;
/* Extract epoch data if obtained. */ /* Extract epoch data if obtained. */
op_data->op_handle = md.body->handle; op_data->op_handle = md.body->handle;
op_data->op_ioepoch = md.body->ioepoch; op_data->op_ioepoch = md.body->ioepoch;
...@@ -1364,7 +1371,6 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr) ...@@ -1364,7 +1371,6 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr)
struct ll_inode_info *lli = ll_i2info(inode); struct ll_inode_info *lli = ll_i2info(inode);
struct md_op_data *op_data = NULL; struct md_op_data *op_data = NULL;
struct md_open_data *mod = NULL; struct md_open_data *mod = NULL;
unsigned int valid = attr->ia_valid;
int rc = 0, rc1 = 0; int rc = 0, rc1 = 0;
ENTRY; ENTRY;
...@@ -1476,13 +1482,6 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr) ...@@ -1476,13 +1482,6 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr)
rc = ll_setattr_ost(inode, attr); rc = ll_setattr_ost(inode, attr);
EXIT; EXIT;
out: out:
if (rc == 0) {
/* Update inode attribute after dirty cache is cleaned
* by truncating OST objects. */
attr->ia_valid |= ATTR_FORCE;
rc = simple_setattr(dentry, attr);
LASSERT(rc == 0);
}
if (op_data) { if (op_data) {
if (op_data->op_ioepoch) { if (op_data->op_ioepoch) {
rc1 = ll_setattr_done_writing(inode, op_data, mod); rc1 = ll_setattr_done_writing(inode, op_data, mod);
...@@ -1501,8 +1500,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr) ...@@ -1501,8 +1500,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr)
ll_stats_ops_tally(ll_i2sbi(inode), (attr->ia_valid & ATTR_SIZE) ? ll_stats_ops_tally(ll_i2sbi(inode), (attr->ia_valid & ATTR_SIZE) ?
LPROC_LL_TRUNC : LPROC_LL_SETATTR, 1); LPROC_LL_TRUNC : LPROC_LL_SETATTR, 1);
attr->ia_valid = valid; return rc;
RETURN(rc);
} }
int ll_setattr(struct dentry *de, struct iattr *attr) int ll_setattr(struct dentry *de, struct iattr *attr)
......
...@@ -980,9 +980,9 @@ int lov_io_init_released(const struct lu_env *env, struct cl_object *obj, ...@@ -980,9 +980,9 @@ int lov_io_init_released(const struct lu_env *env, struct cl_object *obj,
LASSERTF(0, "invalid type %d\n", io->ci_type); LASSERTF(0, "invalid type %d\n", io->ci_type);
case CIT_MISC: case CIT_MISC:
case CIT_FSYNC: case CIT_FSYNC:
case CIT_SETATTR:
result = +1; result = +1;
break; break;
case CIT_SETATTR:
case CIT_READ: case CIT_READ:
case CIT_WRITE: case CIT_WRITE:
case CIT_FAULT: case CIT_FAULT:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment