Backport commit: Ibbb45dd79378d116eb428b76070a417fe08a8142.
* add OBD_CONNECT_UMASK to show whether MDS supports umask.
* client packs umask in create/open request, MDS will use it in
object creation.
* client ignores umask if acl is enabled.
* client enforces umask if MDS doesn't support OBD_CONNECT_UMASK.
* don't update inode->i_mode after creation because la_mode may
not be correct which doesn't consider umask.
* add an acl test for this.
Signed-off-by: Lai Siyao <laisiyao@whamcloud.com>
Change-Id: Ief42dd27fa500c2f13e7dc672c37744a8ecbf489
Reviewed-on: http://review.whamcloud.com/4660
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
#define cfs_curproc_comm() (current->comm)
#define cfs_curproc_fsuid() (current->fsuid)
#define cfs_curproc_fsgid() (current->fsgid)
+#define cfs_curproc_umask() ({ mode_t mask = umask(0); umask(mask); mask; })
extern struct task_struct *current;
int cfs_curproc_is_in_groups(gid_t gid);
OBD_CONNECT_FID | LRU_RESIZE_CONNECT_FLAG | \
OBD_CONNECT_VBR | OBD_CONNECT_LOV_V3 | \
OBD_CONNECT_SOM | OBD_CONNECT_FULL20 | \
- OBD_CONNECT_64BITHASH)
+ OBD_CONNECT_64BITHASH | OBD_CONNECT_UMASK)
#define OST_CONNECT_SUPPORTED (OBD_CONNECT_SRVLOCK | OBD_CONNECT_GRANT | \
OBD_CONNECT_REQPORTAL | OBD_CONNECT_VERSION | \
OBD_CONNECT_TRUNCLOCK | OBD_CONNECT_INDEX | \
* extend cr_flags size without breaking 1.8 compat */
__u32 cr_flags_l; /* for use with open, low 32 bits */
__u32 cr_flags_h; /* for use with open, high 32 bits */
- __u32 cr_padding_3; /* rr_padding_3 */
+ __u32 cr_umask; /* umask for create */
__u32 cr_padding_4; /* rr_padding_4 */
};
return !!(exp->exp_connect_flags & OBD_CONNECT_SOM);
}
+static inline int exp_connect_umask(struct obd_export *exp)
+{
+ return !!(exp->exp_connect_flags & OBD_CONNECT_UMASK);
+}
+
static inline int imp_connect_lru_resize(struct obd_import *imp)
{
struct obd_connect_data *ocd;
first = ll_statahead_enter(parent, &de, 0);
do_lock:
- it->it_create_mode &= ~cfs_curproc_umask();
+ if (!IS_POSIXACL(parent) || !exp_connect_umask(exp))
+ it->it_create_mode &= ~cfs_curproc_umask();
it->it_create_mode |= M_CHECK_STALE;
rc = md_intent_lock(exp, op_data, NULL, 0, it,
lookup_flags,
data->ocd_connect_flags |= OBD_CONNECT_LRU_RESIZE;
#endif
#ifdef CONFIG_FS_POSIX_ACL
- data->ocd_connect_flags |= OBD_CONNECT_ACL;
+ data->ocd_connect_flags |= OBD_CONNECT_ACL | OBD_CONNECT_UMASK;
#endif
data->ocd_ibits_known = MDS_INODELOCK_FULL;
data->ocd_version = LUSTRE_VERSION_CODE;
if (IS_ERR(op_data))
RETURN((void *)op_data);
- it->it_create_mode &= ~cfs_curproc_umask();
+ /* enforce umask if acl disabled or MDS doesn't support umask */
+ if (!IS_POSIXACL(parent) || !exp_connect_umask(ll_i2mdexp(parent)))
+ it->it_create_mode &= ~cfs_curproc_umask();
rc = md_intent_lock(ll_i2mdexp(parent), op_data, NULL, 0, it,
lookup_flags, &req, ll_md_blocking_ast, 0);
name->len, name->name, dir->i_ino, dir->i_generation, dir,
mode, rdev);
- mode &= ~cfs_curproc_umask();
+ if (!IS_POSIXACL(dir) || !exp_connect_umask(ll_i2mdexp(dir)))
+ mode &= ~cfs_curproc_umask();
switch (mode & S_IFMT) {
case 0:
CDEBUG(D_VFSTRACE, "VFS Op:name=%.*s,dir=%lu/%u(%p)\n",
name->len, name->name, dir->i_ino, dir->i_generation, dir);
- mode = (mode & (S_IRWXUGO|S_ISVTX) & ~cfs_curproc_umask()) | S_IFDIR;
+ if (!IS_POSIXACL(dir) || !exp_connect_umask(ll_i2mdexp(dir)))
+ mode &= ~cfs_curproc_umask();
+ mode = (mode & (S_IRWXUGO|S_ISVTX)) | S_IFDIR;
err = ll_new_node(dir, name, NULL, mode, 0, dchild, LUSTRE_OPC_MKDIR);
RETURN(err);
rec->cr_suppgid2 = op_data->op_suppgids[1];
set_mrc_cr_flags(rec, op_data->op_flags & MF_SOM_LOCAL_FLAGS);
rec->cr_bias = op_data->op_bias;
+ rec->cr_umask = cfs_curproc_umask();
mdc_pack_capa(req, &RMF_CAPA1, op_data->op_capa1);
rec->cr_suppgid1 = op_data->op_suppgids[0];
rec->cr_suppgid2 = op_data->op_suppgids[1];
rec->cr_bias = op_data->op_bias;
+ rec->cr_umask = cfs_curproc_umask();
mdc_pack_capa(req, &RMF_CAPA1, op_data->op_capa1);
/* the next buffer is child capa, which is used for replay,
* (2) maybe, the child attributes should be set in OSD when creation.
*/
+ /*
+ * inode mode has been set in creation time, and it's based on umask,
+ * la_mode and acl, don't set here again! (which will go wrong
+ * because below function doesn't consider umask).
+ * I'd suggest set all object attributes in creation time, see above.
+ */
+ ma->ma_attr.la_valid &= ~LA_MODE;
rc = mdd_attr_set_internal(env, child, &ma->ma_attr, handle, 0);
if (rc != 0)
RETURN(rc);
struct thandle *handle)
{
struct dt_object *next = mdd_object_child(o);
- return next->do_ops->do_create(env, next, attr, hint, dof, handle);
+ struct md_ucred *uc = md_ucred(env);
+ __u32 saved;
+ int rc;
+
+ /*
+ * LU-974 enforce client umask in creation.
+ * TODO: CMD needs to handle this for remote object.
+ */
+ saved = xchg(¤t->fs->umask, uc->mu_umask & S_IRWXUGO);
+
+ rc = next->do_ops->do_create(env, next, attr, hint, dof, handle);
+
+ /* restore previous umask value */
+ current->fs->umask = saved;
+
+ return rc;
}
static inline struct obd_capa *mdo_capa_get(const struct lu_env *env,
uc->mu_cap = rec->cr_cap;
uc->mu_suppgids[0] = rec->cr_suppgid1;
uc->mu_suppgids[1] = -1;
+ uc->mu_umask = rec->cr_umask;
rr->rr_fid1 = &rec->cr_fid1;
rr->rr_fid2 = &rec->cr_fid2;
uc->mu_cap = rec->cr_cap;
uc->mu_suppgids[0] = rec->cr_suppgid1;
uc->mu_suppgids[1] = rec->cr_suppgid2;
+ uc->mu_umask = rec->cr_umask;
rr->rr_fid1 = &rec->cr_fid1;
rr->rr_fid2 = &rec->cr_fid2;
struct dt_object_format *dof,
struct thandle *th)
{
-
int result;
result = osd_create_pre(info, obj, attr, th);
if (result == 0)
result = osd_create_post(info, obj, attr, th);
}
+
return result;
}
{
/* Wire protocol assertions generated by 'wirecheck'
* (make -C lustre/utils newwiretest)
- * running on Linux centos5.localhost 2.6.18-prep #3 SMP Mon Mar 22 08:28:01 EDT 2010 x86_64
- * with gcc version 4.1.2 20071124 (Red Hat 4.1.2-42) */
+ * running on Linux chopin 2.6.32.279.lustre #2 SMP Wed Aug 15 14:20:56 CST 2012 x86_64 x86_6
+ * with gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC) */
/* Constants... */
(long long)MGS_TARGET_DEL);
LASSERTF(MGS_SET_INFO == 255, " found %lld\n",
(long long)MGS_SET_INFO);
+ LASSERTF(LDF_EMPTY == 1, " found %lld\n",
+ (long long)LDF_EMPTY);
+ LASSERTF(LDF_COLLIDE == 2, " found %lld\n",
+ (long long)LDF_COLLIDE);
+ LASSERTF(LU_PAGE_SIZE == 4096, " found %lld\n",
+ (long long)LU_PAGE_SIZE);
/* Sizes and Offsets */
/* Checks for struct obd_uuid */
(long long)(int)offsetof(struct obd_connect_data, padding2));
LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding2) == 8, " found %lld\n",
(long long)(int)sizeof(((struct obd_connect_data *)0)->padding2));
- CLASSERT(OBD_CONNECT_RDONLY == 0x1ULL);
- CLASSERT(OBD_CONNECT_INDEX == 0x2ULL);
- CLASSERT(OBD_CONNECT_MDS == 0x4ULL);
- CLASSERT(OBD_CONNECT_GRANT == 0x8ULL);
- CLASSERT(OBD_CONNECT_SRVLOCK == 0x10ULL);
- CLASSERT(OBD_CONNECT_VERSION == 0x20ULL);
- CLASSERT(OBD_CONNECT_REQPORTAL == 0x40ULL);
- CLASSERT(OBD_CONNECT_ACL == 0x80ULL);
- CLASSERT(OBD_CONNECT_XATTR == 0x100ULL);
- CLASSERT(OBD_CONNECT_CROW == 0x200ULL);
- CLASSERT(OBD_CONNECT_TRUNCLOCK == 0x400ULL);
- CLASSERT(OBD_CONNECT_TRANSNO == 0x800ULL);
- CLASSERT(OBD_CONNECT_IBITS == 0x1000ULL);
- CLASSERT(OBD_CONNECT_JOIN == 0x2000ULL);
- CLASSERT(OBD_CONNECT_ATTRFID == 0x4000ULL);
- CLASSERT(OBD_CONNECT_NODEVOH == 0x8000ULL);
- CLASSERT(OBD_CONNECT_RMT_CLIENT == 0x10000ULL);
- CLASSERT(OBD_CONNECT_RMT_CLIENT_FORCE == 0x20000ULL);
- CLASSERT(OBD_CONNECT_BRW_SIZE == 0x40000ULL);
- CLASSERT(OBD_CONNECT_QUOTA64 == 0x80000ULL);
- CLASSERT(OBD_CONNECT_MDS_CAPA == 0x100000ULL);
- CLASSERT(OBD_CONNECT_OSS_CAPA == 0x200000ULL);
- CLASSERT(OBD_CONNECT_CANCELSET == 0x400000ULL);
- CLASSERT(OBD_CONNECT_SOM == 0x800000ULL);
- CLASSERT(OBD_CONNECT_AT == 0x1000000ULL);
- CLASSERT(OBD_CONNECT_LRU_RESIZE == 0x2000000ULL);
- CLASSERT(OBD_CONNECT_MDS_MDS == 0x4000000ULL);
- CLASSERT(OBD_CONNECT_REAL == 0x8000000ULL);
- CLASSERT(OBD_CONNECT_CHANGE_QS == 0x10000000ULL);
- CLASSERT(OBD_CONNECT_CKSUM == 0x20000000ULL);
- CLASSERT(OBD_CONNECT_FID == 0x40000000ULL);
- CLASSERT(OBD_CONNECT_VBR == 0x80000000ULL);
- CLASSERT(OBD_CONNECT_LOV_V3 == 0x100000000ULL);
- CLASSERT(OBD_CONNECT_GRANT_SHRINK == 0x200000000ULL);
- CLASSERT(OBD_CONNECT_SKIP_ORPHAN == 0x400000000ULL);
- CLASSERT(OBD_CONNECT_MAX_EASIZE == 0x800000000ULL);
- CLASSERT(OBD_CONNECT_FULL20 == 0x1000000000ULL);
- CLASSERT(OBD_CONNECT_LAYOUTLOCK == 0x2000000000ULL);
- CLASSERT(OBD_CONNECT_64BITHASH == 0x4000000000ULL);
- CLASSERT(OBD_CONNECT_MAXBYTES == 0x8000000000ULL);
- CLASSERT(OBD_CONNECT_IMP_RECOV == 0x10000000000ULL);
- CLASSERT(OBD_CONNECT_JOBSTATS == 0x20000000000ULL);
- CLASSERT(OBD_CONNECT_UMASK == 0x40000000000ULL);
- CLASSERT(OBD_CONNECT_EINPROGRESS == 0x80000000000ULL);
- CLASSERT(OBD_CONNECT_GRANT_PARAM == 0x100000000000ULL);
+ CLASSERT(OBD_CONNECT_RDONLY == 0x1ULL);
+ CLASSERT(OBD_CONNECT_INDEX == 0x2ULL);
+ CLASSERT(OBD_CONNECT_MDS == 0x4ULL);
+ CLASSERT(OBD_CONNECT_GRANT == 0x8ULL);
+ CLASSERT(OBD_CONNECT_SRVLOCK == 0x10ULL);
+ CLASSERT(OBD_CONNECT_VERSION == 0x20ULL);
+ CLASSERT(OBD_CONNECT_REQPORTAL == 0x40ULL);
+ CLASSERT(OBD_CONNECT_ACL == 0x80ULL);
+ CLASSERT(OBD_CONNECT_XATTR == 0x100ULL);
+ CLASSERT(OBD_CONNECT_CROW == 0x200ULL);
+ CLASSERT(OBD_CONNECT_TRUNCLOCK == 0x400ULL);
+ CLASSERT(OBD_CONNECT_TRANSNO == 0x800ULL);
+ CLASSERT(OBD_CONNECT_IBITS == 0x1000ULL);
+ CLASSERT(OBD_CONNECT_JOIN == 0x2000ULL);
+ CLASSERT(OBD_CONNECT_ATTRFID == 0x4000ULL);
+ CLASSERT(OBD_CONNECT_NODEVOH == 0x8000ULL);
+ CLASSERT(OBD_CONNECT_RMT_CLIENT == 0x10000ULL);
+ CLASSERT(OBD_CONNECT_RMT_CLIENT_FORCE == 0x20000ULL);
+ CLASSERT(OBD_CONNECT_BRW_SIZE == 0x40000ULL);
+ CLASSERT(OBD_CONNECT_QUOTA64 == 0x80000ULL);
+ CLASSERT(OBD_CONNECT_MDS_CAPA == 0x100000ULL);
+ CLASSERT(OBD_CONNECT_OSS_CAPA == 0x200000ULL);
+ CLASSERT(OBD_CONNECT_CANCELSET == 0x400000ULL);
+ CLASSERT(OBD_CONNECT_SOM == 0x800000ULL);
+ CLASSERT(OBD_CONNECT_AT == 0x1000000ULL);
+ CLASSERT(OBD_CONNECT_LRU_RESIZE == 0x2000000ULL);
+ CLASSERT(OBD_CONNECT_MDS_MDS == 0x4000000ULL);
+ CLASSERT(OBD_CONNECT_REAL == 0x8000000ULL);
+ CLASSERT(OBD_CONNECT_CHANGE_QS == 0x10000000ULL);
+ CLASSERT(OBD_CONNECT_CKSUM == 0x20000000ULL);
+ CLASSERT(OBD_CONNECT_FID == 0x40000000ULL);
+ CLASSERT(OBD_CONNECT_VBR == 0x80000000ULL);
+ CLASSERT(OBD_CONNECT_LOV_V3 == 0x100000000ULL);
+ CLASSERT(OBD_CONNECT_GRANT_SHRINK == 0x200000000ULL);
+ CLASSERT(OBD_CONNECT_SKIP_ORPHAN == 0x400000000ULL);
+ CLASSERT(OBD_CONNECT_MAX_EASIZE == 0x800000000ULL);
+ CLASSERT(OBD_CONNECT_FULL20 == 0x1000000000ULL);
+ CLASSERT(OBD_CONNECT_LAYOUTLOCK == 0x2000000000ULL);
+ CLASSERT(OBD_CONNECT_64BITHASH == 0x4000000000ULL);
+ CLASSERT(OBD_CONNECT_MAXBYTES == 0x8000000000ULL);
+ CLASSERT(OBD_CONNECT_IMP_RECOV == 0x10000000000ULL);
+ CLASSERT(OBD_CONNECT_JOBSTATS == 0x20000000000ULL);
+ CLASSERT(OBD_CONNECT_UMASK == 0x40000000000ULL);
+ CLASSERT(OBD_CONNECT_EINPROGRESS == 0x80000000000ULL);
+ CLASSERT(OBD_CONNECT_GRANT_PARAM == 0x100000000000ULL);
/* Checks for struct obdo */
LASSERTF((int)sizeof(struct obdo) == 208, " found %lld\n",
CLASSERT(OBD_FL_CKSUM_CRC32 == 4096);
CLASSERT(OBD_FL_CKSUM_ADLER == 8192);
CLASSERT(OBD_FL_SHRINK_GRANT == 131072);
- CLASSERT(OBD_FL_MMAP == (0x00040000));
- CLASSERT(OBD_FL_RECOV_RESEND == (0x00080000));
+ CLASSERT(OBD_FL_MMAP == 262144);
+ CLASSERT(OBD_FL_RECOV_RESEND == 524288);
CLASSERT(OBD_CKSUM_CRC32 == 1);
CLASSERT(OBD_CKSUM_ADLER == 2);
(long long)(int)offsetof(struct mdt_rec_create, cr_flags_h));
LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_flags_h) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_flags_h));
- LASSERTF((int)offsetof(struct mdt_rec_create, cr_padding_3) == 128, " found %lld\n",
- (long long)(int)offsetof(struct mdt_rec_create, cr_padding_3));
- LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_padding_3) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_padding_3));
+ LASSERTF((int)offsetof(struct mdt_rec_create, cr_umask) == 128, " found %lld\n",
+ (long long)(int)offsetof(struct mdt_rec_create, cr_umask));
+ LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_umask) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_umask));
LASSERTF((int)offsetof(struct mdt_rec_create, cr_padding_4) == 132, " found %lld\n",
(long long)(int)offsetof(struct mdt_rec_create, cr_padding_4));
LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_padding_4) == 4, " found %lld\n",
(long long)(int)offsetof(struct link_ea_entry, lee_name));
LASSERTF((int)sizeof(((struct link_ea_entry *)0)->lee_name) == 0, " found %lld\n",
(long long)(int)sizeof(((struct link_ea_entry *)0)->lee_name));
+
+ /* Checks for struct hsm_user_item */
+ LASSERTF((int)sizeof(struct hsm_user_item) == 32, " found %lld\n",
+ (long long)(int)sizeof(struct hsm_user_item));
+ LASSERTF((int)offsetof(struct hsm_user_item, hui_fid) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct hsm_user_item, hui_fid));
+ LASSERTF((int)sizeof(((struct hsm_user_item *)0)->hui_fid) == 16, " found %lld\n",
+ (long long)(int)sizeof(((struct hsm_user_item *)0)->hui_fid));
+ LASSERTF((int)offsetof(struct hsm_user_item, hui_extent) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct hsm_user_item, hui_extent));
+ LASSERTF((int)sizeof(((struct hsm_user_item *)0)->hui_extent) == 16, " found %lld\n",
+ (long long)(int)sizeof(((struct hsm_user_item *)0)->hui_extent));
+
+ /* Checks for struct hsm_user_request */
+ LASSERTF((int)sizeof(struct hsm_user_request) == 16, " found %lld\n",
+ (long long)(int)sizeof(struct hsm_user_request));
+ LASSERTF((int)offsetof(struct hsm_user_request, hur_action) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct hsm_user_request, hur_action));
+ LASSERTF((int)sizeof(((struct hsm_user_request *)0)->hur_action) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct hsm_user_request *)0)->hur_action));
+ LASSERTF((int)offsetof(struct hsm_user_request, hur_archive_num) == 4, " found %lld\n",
+ (long long)(int)offsetof(struct hsm_user_request, hur_archive_num));
+ LASSERTF((int)sizeof(((struct hsm_user_request *)0)->hur_archive_num) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct hsm_user_request *)0)->hur_archive_num));
+ LASSERTF((int)offsetof(struct hsm_user_request, hur_itemcount) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct hsm_user_request, hur_itemcount));
+ LASSERTF((int)sizeof(((struct hsm_user_request *)0)->hur_itemcount) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct hsm_user_request *)0)->hur_itemcount));
+ LASSERTF((int)offsetof(struct hsm_user_request, hur_data_len) == 12, " found %lld\n",
+ (long long)(int)offsetof(struct hsm_user_request, hur_data_len));
+ LASSERTF((int)sizeof(((struct hsm_user_request *)0)->hur_data_len) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct hsm_user_request *)0)->hur_data_len));
+
+ /* Checks for struct hsm_user_state */
+ LASSERTF((int)sizeof(struct hsm_user_state) == 32, " found %lld\n",
+ (long long)(int)sizeof(struct hsm_user_state));
+ LASSERTF((int)offsetof(struct hsm_user_state, hus_states) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct hsm_user_state, hus_states));
+ LASSERTF((int)sizeof(((struct hsm_user_state *)0)->hus_states) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct hsm_user_state *)0)->hus_states));
+ LASSERTF((int)offsetof(struct hsm_user_state, hus_archive_num) == 4, " found %lld\n",
+ (long long)(int)offsetof(struct hsm_user_state, hus_archive_num));
+ LASSERTF((int)sizeof(((struct hsm_user_state *)0)->hus_archive_num) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct hsm_user_state *)0)->hus_archive_num));
+ LASSERTF((int)offsetof(struct hsm_user_state, hus_in_progress_state) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct hsm_user_state, hus_in_progress_state));
+ LASSERTF((int)sizeof(((struct hsm_user_state *)0)->hus_in_progress_state) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct hsm_user_state *)0)->hus_in_progress_state));
+ LASSERTF((int)offsetof(struct hsm_user_state, hus_in_progress_action) == 12, " found %lld\n",
+ (long long)(int)offsetof(struct hsm_user_state, hus_in_progress_action));
+ LASSERTF((int)sizeof(((struct hsm_user_state *)0)->hus_in_progress_action) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct hsm_user_state *)0)->hus_in_progress_action));
+ LASSERTF((int)offsetof(struct hsm_user_state, hus_in_progress_location) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct hsm_user_state, hus_in_progress_location));
+ LASSERTF((int)sizeof(((struct hsm_user_state *)0)->hus_in_progress_location) == 16, " found %lld\n",
+ (long long)(int)sizeof(((struct hsm_user_state *)0)->hus_in_progress_location));
}
+
--- /dev/null
+LU-974 ignore umask when default acl with mask is set
+
+ $ umask 022
+ $ mkdir d
+
+ $ touch d/f1
+ $ ls -dl d/f1 | awk '{ print $1 }'
+ > -rw-r--r--
+
+ $ setfacl -R -d -m mask:007 d
+ $ touch d/f2
+ $ ls -dl d/f2 | awk '{ print $1 }'
+ > -rw-rw-r--+
+
+ $ umask 077
+ $ touch f3
+ $ ls -dl f3 | awk '{ print $1 }'
+ > -rw-------
run_acl_subtest inheritance || error "inheritance test failed"
rm -f make-tree
+ echo "LU-974 ignore umask when acl is enabled..."
+ mkdir $DIR/974
+ cd $DIR/974
+ run_acl_subtest 974 || error "LU-974 test failed"
+ rm -rf $DIR/974
+
cd $SAVE_PWD
umask $SAVE_UMASK
CHECK_MEMBER(mdt_rec_create, cr_bias);
CHECK_MEMBER(mdt_rec_create, cr_flags_l);
CHECK_MEMBER(mdt_rec_create, cr_flags_h);
- CHECK_MEMBER(mdt_rec_create, cr_padding_3);
+ CHECK_MEMBER(mdt_rec_create, cr_umask);
CHECK_MEMBER(mdt_rec_create, cr_padding_4);
}
{
/* Wire protocol assertions generated by 'wirecheck'
* (make -C lustre/utils newwiretest)
- * running on Linux centos5.localhost 2.6.18-prep #3 SMP Mon Mar 22 08:28:01 EDT 2010 x86_64
- * with gcc version 4.1.2 20071124 (Red Hat 4.1.2-42) */
+ * running on Linux chopin 2.6.32.279.lustre #2 SMP Wed Aug 15 14:20:56 CST 2012 x86_64 x86_6
+ * with gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC) */
/* Constants... */
(long long)MGS_TARGET_DEL);
LASSERTF(MGS_SET_INFO == 255, " found %lld\n",
(long long)MGS_SET_INFO);
+ LASSERTF(LDF_EMPTY == 1, " found %lld\n",
+ (long long)LDF_EMPTY);
+ LASSERTF(LDF_COLLIDE == 2, " found %lld\n",
+ (long long)LDF_COLLIDE);
+ LASSERTF(LU_PAGE_SIZE == 4096, " found %lld\n",
+ (long long)LU_PAGE_SIZE);
/* Sizes and Offsets */
/* Checks for struct obd_uuid */
(long long)(int)offsetof(struct obd_connect_data, padding2));
LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding2) == 8, " found %lld\n",
(long long)(int)sizeof(((struct obd_connect_data *)0)->padding2));
- CLASSERT(OBD_CONNECT_RDONLY == 0x1ULL);
- CLASSERT(OBD_CONNECT_INDEX == 0x2ULL);
- CLASSERT(OBD_CONNECT_MDS == 0x4ULL);
- CLASSERT(OBD_CONNECT_GRANT == 0x8ULL);
- CLASSERT(OBD_CONNECT_SRVLOCK == 0x10ULL);
- CLASSERT(OBD_CONNECT_VERSION == 0x20ULL);
- CLASSERT(OBD_CONNECT_REQPORTAL == 0x40ULL);
- CLASSERT(OBD_CONNECT_ACL == 0x80ULL);
- CLASSERT(OBD_CONNECT_XATTR == 0x100ULL);
- CLASSERT(OBD_CONNECT_CROW == 0x200ULL);
- CLASSERT(OBD_CONNECT_TRUNCLOCK == 0x400ULL);
- CLASSERT(OBD_CONNECT_TRANSNO == 0x800ULL);
- CLASSERT(OBD_CONNECT_IBITS == 0x1000ULL);
- CLASSERT(OBD_CONNECT_JOIN == 0x2000ULL);
- CLASSERT(OBD_CONNECT_ATTRFID == 0x4000ULL);
- CLASSERT(OBD_CONNECT_NODEVOH == 0x8000ULL);
- CLASSERT(OBD_CONNECT_RMT_CLIENT == 0x10000ULL);
- CLASSERT(OBD_CONNECT_RMT_CLIENT_FORCE == 0x20000ULL);
- CLASSERT(OBD_CONNECT_BRW_SIZE == 0x40000ULL);
- CLASSERT(OBD_CONNECT_QUOTA64 == 0x80000ULL);
- CLASSERT(OBD_CONNECT_MDS_CAPA == 0x100000ULL);
- CLASSERT(OBD_CONNECT_OSS_CAPA == 0x200000ULL);
- CLASSERT(OBD_CONNECT_CANCELSET == 0x400000ULL);
- CLASSERT(OBD_CONNECT_SOM == 0x800000ULL);
- CLASSERT(OBD_CONNECT_AT == 0x1000000ULL);
- CLASSERT(OBD_CONNECT_LRU_RESIZE == 0x2000000ULL);
- CLASSERT(OBD_CONNECT_MDS_MDS == 0x4000000ULL);
- CLASSERT(OBD_CONNECT_REAL == 0x8000000ULL);
- CLASSERT(OBD_CONNECT_CHANGE_QS == 0x10000000ULL);
- CLASSERT(OBD_CONNECT_CKSUM == 0x20000000ULL);
- CLASSERT(OBD_CONNECT_FID == 0x40000000ULL);
- CLASSERT(OBD_CONNECT_VBR == 0x80000000ULL);
- CLASSERT(OBD_CONNECT_LOV_V3 == 0x100000000ULL);
- CLASSERT(OBD_CONNECT_GRANT_SHRINK == 0x200000000ULL);
- CLASSERT(OBD_CONNECT_SKIP_ORPHAN == 0x400000000ULL);
- CLASSERT(OBD_CONNECT_MAX_EASIZE == 0x800000000ULL);
- CLASSERT(OBD_CONNECT_FULL20 == 0x1000000000ULL);
- CLASSERT(OBD_CONNECT_LAYOUTLOCK == 0x2000000000ULL);
- CLASSERT(OBD_CONNECT_64BITHASH == 0x4000000000ULL);
- CLASSERT(OBD_CONNECT_MAXBYTES == 0x8000000000ULL);
- CLASSERT(OBD_CONNECT_IMP_RECOV == 0x10000000000ULL);
- CLASSERT(OBD_CONNECT_JOBSTATS == 0x20000000000ULL);
- CLASSERT(OBD_CONNECT_UMASK == 0x40000000000ULL);
- CLASSERT(OBD_CONNECT_EINPROGRESS == 0x80000000000ULL);
- CLASSERT(OBD_CONNECT_GRANT_PARAM == 0x100000000000ULL);
+ CLASSERT(OBD_CONNECT_RDONLY == 0x1ULL);
+ CLASSERT(OBD_CONNECT_INDEX == 0x2ULL);
+ CLASSERT(OBD_CONNECT_MDS == 0x4ULL);
+ CLASSERT(OBD_CONNECT_GRANT == 0x8ULL);
+ CLASSERT(OBD_CONNECT_SRVLOCK == 0x10ULL);
+ CLASSERT(OBD_CONNECT_VERSION == 0x20ULL);
+ CLASSERT(OBD_CONNECT_REQPORTAL == 0x40ULL);
+ CLASSERT(OBD_CONNECT_ACL == 0x80ULL);
+ CLASSERT(OBD_CONNECT_XATTR == 0x100ULL);
+ CLASSERT(OBD_CONNECT_CROW == 0x200ULL);
+ CLASSERT(OBD_CONNECT_TRUNCLOCK == 0x400ULL);
+ CLASSERT(OBD_CONNECT_TRANSNO == 0x800ULL);
+ CLASSERT(OBD_CONNECT_IBITS == 0x1000ULL);
+ CLASSERT(OBD_CONNECT_JOIN == 0x2000ULL);
+ CLASSERT(OBD_CONNECT_ATTRFID == 0x4000ULL);
+ CLASSERT(OBD_CONNECT_NODEVOH == 0x8000ULL);
+ CLASSERT(OBD_CONNECT_RMT_CLIENT == 0x10000ULL);
+ CLASSERT(OBD_CONNECT_RMT_CLIENT_FORCE == 0x20000ULL);
+ CLASSERT(OBD_CONNECT_BRW_SIZE == 0x40000ULL);
+ CLASSERT(OBD_CONNECT_QUOTA64 == 0x80000ULL);
+ CLASSERT(OBD_CONNECT_MDS_CAPA == 0x100000ULL);
+ CLASSERT(OBD_CONNECT_OSS_CAPA == 0x200000ULL);
+ CLASSERT(OBD_CONNECT_CANCELSET == 0x400000ULL);
+ CLASSERT(OBD_CONNECT_SOM == 0x800000ULL);
+ CLASSERT(OBD_CONNECT_AT == 0x1000000ULL);
+ CLASSERT(OBD_CONNECT_LRU_RESIZE == 0x2000000ULL);
+ CLASSERT(OBD_CONNECT_MDS_MDS == 0x4000000ULL);
+ CLASSERT(OBD_CONNECT_REAL == 0x8000000ULL);
+ CLASSERT(OBD_CONNECT_CHANGE_QS == 0x10000000ULL);
+ CLASSERT(OBD_CONNECT_CKSUM == 0x20000000ULL);
+ CLASSERT(OBD_CONNECT_FID == 0x40000000ULL);
+ CLASSERT(OBD_CONNECT_VBR == 0x80000000ULL);
+ CLASSERT(OBD_CONNECT_LOV_V3 == 0x100000000ULL);
+ CLASSERT(OBD_CONNECT_GRANT_SHRINK == 0x200000000ULL);
+ CLASSERT(OBD_CONNECT_SKIP_ORPHAN == 0x400000000ULL);
+ CLASSERT(OBD_CONNECT_MAX_EASIZE == 0x800000000ULL);
+ CLASSERT(OBD_CONNECT_FULL20 == 0x1000000000ULL);
+ CLASSERT(OBD_CONNECT_LAYOUTLOCK == 0x2000000000ULL);
+ CLASSERT(OBD_CONNECT_64BITHASH == 0x4000000000ULL);
+ CLASSERT(OBD_CONNECT_MAXBYTES == 0x8000000000ULL);
+ CLASSERT(OBD_CONNECT_IMP_RECOV == 0x10000000000ULL);
+ CLASSERT(OBD_CONNECT_JOBSTATS == 0x20000000000ULL);
+ CLASSERT(OBD_CONNECT_UMASK == 0x40000000000ULL);
+ CLASSERT(OBD_CONNECT_EINPROGRESS == 0x80000000000ULL);
+ CLASSERT(OBD_CONNECT_GRANT_PARAM == 0x100000000000ULL);
/* Checks for struct obdo */
LASSERTF((int)sizeof(struct obdo) == 208, " found %lld\n",
CLASSERT(OBD_FL_CKSUM_CRC32 == 4096);
CLASSERT(OBD_FL_CKSUM_ADLER == 8192);
CLASSERT(OBD_FL_SHRINK_GRANT == 131072);
- CLASSERT(OBD_FL_MMAP == (0x00040000));
- CLASSERT(OBD_FL_RECOV_RESEND == (0x00080000));
+ CLASSERT(OBD_FL_MMAP == 262144);
+ CLASSERT(OBD_FL_RECOV_RESEND == 524288);
CLASSERT(OBD_CKSUM_CRC32 == 1);
CLASSERT(OBD_CKSUM_ADLER == 2);
(long long)(int)offsetof(struct mdt_rec_create, cr_flags_h));
LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_flags_h) == 4, " found %lld\n",
(long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_flags_h));
- LASSERTF((int)offsetof(struct mdt_rec_create, cr_padding_3) == 128, " found %lld\n",
- (long long)(int)offsetof(struct mdt_rec_create, cr_padding_3));
- LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_padding_3) == 4, " found %lld\n",
- (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_padding_3));
+ LASSERTF((int)offsetof(struct mdt_rec_create, cr_umask) == 128, " found %lld\n",
+ (long long)(int)offsetof(struct mdt_rec_create, cr_umask));
+ LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_umask) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct mdt_rec_create *)0)->cr_umask));
LASSERTF((int)offsetof(struct mdt_rec_create, cr_padding_4) == 132, " found %lld\n",
(long long)(int)offsetof(struct mdt_rec_create, cr_padding_4));
LASSERTF((int)sizeof(((struct mdt_rec_create *)0)->cr_padding_4) == 4, " found %lld\n",
(long long)(int)offsetof(struct link_ea_entry, lee_name));
LASSERTF((int)sizeof(((struct link_ea_entry *)0)->lee_name) == 0, " found %lld\n",
(long long)(int)sizeof(((struct link_ea_entry *)0)->lee_name));
+
+ /* Checks for struct hsm_user_item */
+ LASSERTF((int)sizeof(struct hsm_user_item) == 32, " found %lld\n",
+ (long long)(int)sizeof(struct hsm_user_item));
+ LASSERTF((int)offsetof(struct hsm_user_item, hui_fid) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct hsm_user_item, hui_fid));
+ LASSERTF((int)sizeof(((struct hsm_user_item *)0)->hui_fid) == 16, " found %lld\n",
+ (long long)(int)sizeof(((struct hsm_user_item *)0)->hui_fid));
+ LASSERTF((int)offsetof(struct hsm_user_item, hui_extent) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct hsm_user_item, hui_extent));
+ LASSERTF((int)sizeof(((struct hsm_user_item *)0)->hui_extent) == 16, " found %lld\n",
+ (long long)(int)sizeof(((struct hsm_user_item *)0)->hui_extent));
+
+ /* Checks for struct hsm_user_request */
+ LASSERTF((int)sizeof(struct hsm_user_request) == 16, " found %lld\n",
+ (long long)(int)sizeof(struct hsm_user_request));
+ LASSERTF((int)offsetof(struct hsm_user_request, hur_action) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct hsm_user_request, hur_action));
+ LASSERTF((int)sizeof(((struct hsm_user_request *)0)->hur_action) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct hsm_user_request *)0)->hur_action));
+ LASSERTF((int)offsetof(struct hsm_user_request, hur_archive_num) == 4, " found %lld\n",
+ (long long)(int)offsetof(struct hsm_user_request, hur_archive_num));
+ LASSERTF((int)sizeof(((struct hsm_user_request *)0)->hur_archive_num) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct hsm_user_request *)0)->hur_archive_num));
+ LASSERTF((int)offsetof(struct hsm_user_request, hur_itemcount) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct hsm_user_request, hur_itemcount));
+ LASSERTF((int)sizeof(((struct hsm_user_request *)0)->hur_itemcount) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct hsm_user_request *)0)->hur_itemcount));
+ LASSERTF((int)offsetof(struct hsm_user_request, hur_data_len) == 12, " found %lld\n",
+ (long long)(int)offsetof(struct hsm_user_request, hur_data_len));
+ LASSERTF((int)sizeof(((struct hsm_user_request *)0)->hur_data_len) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct hsm_user_request *)0)->hur_data_len));
+
+ /* Checks for struct hsm_user_state */
+ LASSERTF((int)sizeof(struct hsm_user_state) == 32, " found %lld\n",
+ (long long)(int)sizeof(struct hsm_user_state));
+ LASSERTF((int)offsetof(struct hsm_user_state, hus_states) == 0, " found %lld\n",
+ (long long)(int)offsetof(struct hsm_user_state, hus_states));
+ LASSERTF((int)sizeof(((struct hsm_user_state *)0)->hus_states) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct hsm_user_state *)0)->hus_states));
+ LASSERTF((int)offsetof(struct hsm_user_state, hus_archive_num) == 4, " found %lld\n",
+ (long long)(int)offsetof(struct hsm_user_state, hus_archive_num));
+ LASSERTF((int)sizeof(((struct hsm_user_state *)0)->hus_archive_num) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct hsm_user_state *)0)->hus_archive_num));
+ LASSERTF((int)offsetof(struct hsm_user_state, hus_in_progress_state) == 8, " found %lld\n",
+ (long long)(int)offsetof(struct hsm_user_state, hus_in_progress_state));
+ LASSERTF((int)sizeof(((struct hsm_user_state *)0)->hus_in_progress_state) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct hsm_user_state *)0)->hus_in_progress_state));
+ LASSERTF((int)offsetof(struct hsm_user_state, hus_in_progress_action) == 12, " found %lld\n",
+ (long long)(int)offsetof(struct hsm_user_state, hus_in_progress_action));
+ LASSERTF((int)sizeof(((struct hsm_user_state *)0)->hus_in_progress_action) == 4, " found %lld\n",
+ (long long)(int)sizeof(((struct hsm_user_state *)0)->hus_in_progress_action));
+ LASSERTF((int)offsetof(struct hsm_user_state, hus_in_progress_location) == 16, " found %lld\n",
+ (long long)(int)offsetof(struct hsm_user_state, hus_in_progress_location));
+ LASSERTF((int)sizeof(((struct hsm_user_state *)0)->hus_in_progress_location) == 16, " found %lld\n",
+ (long long)(int)sizeof(((struct hsm_user_state *)0)->hus_in_progress_location));
}
+