From: Alex Zhuravlev Date: Thu, 17 Jan 2013 07:43:08 +0000 (+0400) Subject: LU-2607 mdd: preserve input arguments in mdd_create() X-Git-Tag: 2.3.60~44 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=7f80c112dca2c75b5c7d3ae3fae55e0dd4539177 LU-2607 mdd: preserve input arguments in mdd_create() all input arguments are supposed to stay as is so that the caller can re-use them again. Signed-off-by: Alex Zhuravlev Change-Id: Ie2be78e702bfa9b7febafe7d106f09beccbf48d3 Reviewed-on: http://review.whamcloud.com/5048 Reviewed-by: wangdi Reviewed-by: Mike Pershin Tested-by: Hudson Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/mdd/mdd_dir.c b/lustre/mdd/mdd_dir.c index decdb60..6ba30e3 100644 --- a/lustre/mdd/mdd_dir.c +++ b/lustre/mdd/mdd_dir.c @@ -1442,10 +1442,13 @@ int mdd_object_initialize(const struct lu_env *env, const struct lu_fid *pfid, * because below function doesn't consider umask). * I'd suggest set all object attributes in creation time, see above. */ + LASSERT(attr->la_valid & LA_MODE); attr->la_valid &= ~LA_MODE; rc = mdd_attr_set_internal(env, child, attr, handle, 0); - if (rc != 0) - RETURN(rc); + /* arguments are supposed to stay the same */ + attr->la_valid |= LA_MODE; + if (rc != 0) + RETURN(rc); if (S_ISDIR(attr->la_mode)) { /* Add "." and ".." for newly created dir */