* 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: Ibbb45dd79378d116eb428b76070a417fe08a8142
Reviewed-on: http://review.whamcloud.com/1972
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>
16 files changed:
#define cfs_curproc_comm() (current->comm)
#define cfs_curproc_fsuid() (current->fsuid)
#define cfs_curproc_fsgid() (current->fsgid)
#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);
extern struct task_struct *current;
int cfs_curproc_is_in_groups(gid_t gid);
OBD_CONNECT_SOM | OBD_CONNECT_FULL20 | \
OBD_CONNECT_64BITHASH | OBD_CONNECT_JOBSTATS | \
OBD_CONNECT_EINPROGRESS | \
OBD_CONNECT_SOM | OBD_CONNECT_FULL20 | \
OBD_CONNECT_64BITHASH | OBD_CONNECT_JOBSTATS | \
OBD_CONNECT_EINPROGRESS | \
- OBD_CONNECT_LIGHTWEIGHT)
+ OBD_CONNECT_LIGHTWEIGHT | 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 | \
#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 */
* 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 */
};
__u32 cr_padding_4; /* rr_padding_4 */
};
return !!(exp->exp_connect_flags & OBD_CONNECT_SOM);
}
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;
static inline int imp_connect_lru_resize(struct obd_import *imp)
{
struct obd_connect_data *ocd;
if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data));
if (IS_ERR(op_data))
RETURN(PTR_ERR(op_data));
- 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,
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_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
if (OBD_FAIL_CHECK(OBD_FAIL_MDC_LIGHTWEIGHT))
#endif
if (OBD_FAIL_CHECK(OBD_FAIL_MDC_LIGHTWEIGHT))
if (IS_ERR(op_data))
RETURN((void *)op_data);
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);
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);
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:
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);
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);
if (!err)
err = ll_new_node(dir, name, NULL, mode, 0, dchild, LUSTRE_OPC_MKDIR);
if (!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_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);
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_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,
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.
*/
* (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.
+ */
+ attr->la_valid &= ~LA_MODE;
rc = mdd_attr_set_internal(env, child, attr, handle, 0);
if (rc != 0)
RETURN(rc);
rc = mdd_attr_set_internal(env, child, attr, handle, 0);
if (rc != 0)
RETURN(rc);
struct thandle *handle)
{
struct dt_object *next = mdd_object_child(o);
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;
uc->mu_cap = rec->cr_cap;
uc->mu_suppgids[0] = rec->cr_suppgid1;
uc->mu_suppgids[1] = -1;
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;
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_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;
rr->rr_fid1 = &rec->cr_fid1;
rr->rr_fid2 = &rec->cr_fid2;
struct thandle *th)
{
int result;
struct thandle *th)
{
int result;
- __u32 umask;
-
- /* we drop umask so that permissions we pass are not affected */
- umask = current->fs->umask;
- current->fs->umask = 0;
result = osd_create_type_f(dof->dof_type)(info, obj, attr, hint, dof,
th);
result = osd_create_type_f(dof->dof_type)(info, obj, attr, hint, dof,
th);
unlock_new_inode(obj->oo_inode);
}
unlock_new_inode(obj->oo_inode);
}
- /* restore previous umask value */
- current->fs->umask = umask;
-
{
/* Wire protocol assertions generated by 'wirecheck'
* (make -C lustre/utils newwiretest)
{
/* Wire protocol assertions generated by 'wirecheck'
* (make -C lustre/utils newwiretest)
- * running on Linux rhel6 2.6.32 #1 SMP Mon Aug 20 00:36:28 EDT 2012 x86_64 x86_64 x86_64 GNU
+ * running on Linux chopin 2.6.32.wc #9 SMP Thu Feb 9 14:43:41 CST 2012 x86_64 x86_64 x86_64
* with gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC) */
* with gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC) */
CLASSERT(LDLM_MAX_TYPE == 14);
CLASSERT(LUSTRE_RES_ID_SEQ_OFF == 0);
CLASSERT(LUSTRE_RES_ID_VER_OID_OFF == 1);
CLASSERT(LDLM_MAX_TYPE == 14);
CLASSERT(LUSTRE_RES_ID_SEQ_OFF == 0);
CLASSERT(LUSTRE_RES_ID_VER_OID_OFF == 1);
- CLASSERT(LUSTRE_RES_ID_QUOTA_SEQ_OFF == 2);
- CLASSERT(LUSTRE_RES_ID_QUOTA_VER_OID_OFF == 3);
+ CLASSERT(LUSTRE_RES_ID_QUOTA_SEQ_OFF == 2);
+ CLASSERT(LUSTRE_RES_ID_QUOTA_VER_OID_OFF == 3);
CLASSERT(LUSTRE_RES_ID_HSH_OFF == 3);
CLASSERT(LUSTRE_RES_ID_HSH_OFF == 3);
- CLASSERT(LQUOTA_TYPE_USR == 0);
- CLASSERT(LQUOTA_TYPE_GRP == 1);
- CLASSERT(LQUOTA_RES_MD == 1);
- CLASSERT(LQUOTA_RES_DT == 2);
+ CLASSERT(LQUOTA_TYPE_USR == 0);
+ CLASSERT(LQUOTA_TYPE_GRP == 1);
+ CLASSERT(LQUOTA_RES_MD == 1);
+ CLASSERT(LQUOTA_RES_DT == 2);
LASSERTF(OBD_PING == 400, "found %lld\n",
(long long)OBD_PING);
LASSERTF(OBD_LOG_CANCEL == 401, "found %lld\n",
LASSERTF(OBD_PING == 400, "found %lld\n",
(long long)OBD_PING);
LASSERTF(OBD_LOG_CANCEL == 401, "found %lld\n",
(long long)LDF_COLLIDE);
LASSERTF(LU_PAGE_SIZE == 4096, "found %lld\n",
(long long)LU_PAGE_SIZE);
(long long)LDF_COLLIDE);
LASSERTF(LU_PAGE_SIZE == 4096, "found %lld\n",
(long long)LU_PAGE_SIZE);
- LASSERTF((int)sizeof(union lu_page) == 4096, "found %lld\n",
- (long long)(int)sizeof(union lu_page));
+ /* Checks for union lu_page */
+ LASSERTF((int)sizeof(union lu_page) == 4096, "found %lld\n",
+ (long long)(int)sizeof(union lu_page));
/* Checks for struct lustre_handle */
LASSERTF((int)sizeof(struct lustre_handle) == 8, "found %lld\n",
/* Checks for struct lustre_handle */
LASSERTF((int)sizeof(struct lustre_handle) == 8, "found %lld\n",
OBD_CONNECT_FLOCK_OWNER);
LASSERTF(OBD_CONNECT_LVB_TYPE == 0x400000000000ULL, "found 0x%.16llxULL\n",
OBD_CONNECT_LVB_TYPE);
OBD_CONNECT_FLOCK_OWNER);
LASSERTF(OBD_CONNECT_LVB_TYPE == 0x400000000000ULL, "found 0x%.16llxULL\n",
OBD_CONNECT_LVB_TYPE);
- LASSERTF(OBD_CONNECT_NANOSEC_TIME == 0x800000000000ULL, "found 0x%.16llxULL\n",
+ LASSERTF(OBD_CONNECT_NANOSEC_TIME == 0x800000000000ULL, "found 0x%.16llxULL\n",
OBD_CONNECT_NANOSEC_TIME);
LASSERTF(OBD_CONNECT_LIGHTWEIGHT == 0x1000000000000ULL, "found 0x%.16llxULL\n",
OBD_CONNECT_LIGHTWEIGHT);
OBD_CONNECT_NANOSEC_TIME);
LASSERTF(OBD_CONNECT_LIGHTWEIGHT == 0x1000000000000ULL, "found 0x%.16llxULL\n",
OBD_CONNECT_LIGHTWEIGHT);
- LASSERTF(OBD_CONNECT_SHORTIO == 0x2000000000000ULL, "found 0x%.16llxULL\n",
- OBD_CONNECT_SHORTIO);
+ LASSERTF(OBD_CONNECT_SHORTIO == 0x2000000000000ULL, "found 0x%.16llxULL\n",
+ OBD_CONNECT_SHORTIO);
LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n",
(unsigned)OBD_CKSUM_CRC32);
LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n",
LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n",
(unsigned)OBD_CKSUM_CRC32);
LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n",
(long long)(int)offsetof(struct obd_statfs, os_state));
LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_state) == 4, "found %lld\n",
(long long)(int)sizeof(((struct obd_statfs *)0)->os_state));
(long long)(int)offsetof(struct obd_statfs, os_state));
LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_state) == 4, "found %lld\n",
(long long)(int)sizeof(((struct obd_statfs *)0)->os_state));
- LASSERTF((int)offsetof(struct obd_statfs, os_fprecreated) == 108, "found %lld\n",
- (long long)(int)offsetof(struct obd_statfs, os_fprecreated));
- LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_fprecreated) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct obd_statfs *)0)->os_fprecreated));
+ LASSERTF((int)offsetof(struct obd_statfs, os_fprecreated) == 108, "found %lld\n",
+ (long long)(int)offsetof(struct obd_statfs, os_fprecreated));
+ LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_fprecreated) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct obd_statfs *)0)->os_fprecreated));
LASSERTF((int)offsetof(struct obd_statfs, os_spare2) == 112, "found %lld\n",
(long long)(int)offsetof(struct obd_statfs, os_spare2));
LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_spare2) == 4, "found %lld\n",
LASSERTF((int)offsetof(struct obd_statfs, os_spare2) == 112, "found %lld\n",
(long long)(int)offsetof(struct obd_statfs, os_spare2));
LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_spare2) == 4, "found %lld\n",
LASSERTF((int)sizeof(union lquota_id) == 16, "found %lld\n",
(long long)(int)sizeof(union lquota_id));
LASSERTF((int)sizeof(union lquota_id) == 16, "found %lld\n",
(long long)(int)sizeof(union lquota_id));
- LASSERTF(QUOTABLOCK_BITS == 10, "found %lld\n",
- (long long)QUOTABLOCK_BITS);
- LASSERTF(QUOTABLOCK_SIZE == 1024, "found %lld\n",
- (long long)QUOTABLOCK_SIZE);
+ LASSERTF(QUOTABLOCK_BITS == 10, "found %lld\n",
+ (long long)QUOTABLOCK_BITS);
+ LASSERTF(QUOTABLOCK_SIZE == 1024, "found %lld\n",
+ (long long)QUOTABLOCK_SIZE);
/* Checks for struct obd_quotactl */
LASSERTF((int)sizeof(struct obd_quotactl) == 112, "found %lld\n",
/* Checks for struct obd_quotactl */
LASSERTF((int)sizeof(struct obd_quotactl) == 112, "found %lld\n",
(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));
(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",
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 lquota_lvb, lvb_id_rel));
LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_id_rel) == 8, "found %lld\n",
(long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_id_rel));
(long long)(int)offsetof(struct lquota_lvb, lvb_id_rel));
LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_id_rel) == 8, "found %lld\n",
(long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_id_rel));
- LASSERTF(LQUOTA_FL_EDQUOT == 1, "found %lld\n",
- (long long)LQUOTA_FL_EDQUOT);
LASSERTF((int)offsetof(struct lquota_lvb, lvb_id_qunit) == 24, "found %lld\n",
(long long)(int)offsetof(struct lquota_lvb, lvb_id_qunit));
LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_id_qunit) == 8, "found %lld\n",
LASSERTF((int)offsetof(struct lquota_lvb, lvb_id_qunit) == 24, "found %lld\n",
(long long)(int)offsetof(struct lquota_lvb, lvb_id_qunit));
LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_id_qunit) == 8, "found %lld\n",
(long long)(int)offsetof(struct lquota_lvb, lvb_pad1));
LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_pad1) == 8, "found %lld\n",
(long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_pad1));
(long long)(int)offsetof(struct lquota_lvb, lvb_pad1));
LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_pad1) == 8, "found %lld\n",
(long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_pad1));
+ LASSERTF(LQUOTA_FL_EDQUOT == 1, "found %lld\n",
+ (long long)LQUOTA_FL_EDQUOT);
/* Checks for struct ldlm_gl_lquota_desc */
LASSERTF((int)sizeof(struct ldlm_gl_lquota_desc) == 64, "found %lld\n",
/* Checks for struct ldlm_gl_lquota_desc */
LASSERTF((int)sizeof(struct ldlm_gl_lquota_desc) == 64, "found %lld\n",
--- /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
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
cd $SAVE_PWD
umask $SAVE_UMASK
CHECK_MEMBER(obd_statfs, os_bsize);
CHECK_MEMBER(obd_statfs, os_namelen);
CHECK_MEMBER(obd_statfs, os_state);
CHECK_MEMBER(obd_statfs, os_bsize);
CHECK_MEMBER(obd_statfs, os_namelen);
CHECK_MEMBER(obd_statfs, os_state);
- CHECK_MEMBER(obd_statfs, os_spare1);
+ CHECK_MEMBER(obd_statfs, os_fprecreated);
CHECK_MEMBER(obd_statfs, os_spare2);
CHECK_MEMBER(obd_statfs, os_spare3);
CHECK_MEMBER(obd_statfs, os_spare4);
CHECK_MEMBER(obd_statfs, os_spare2);
CHECK_MEMBER(obd_statfs, os_spare3);
CHECK_MEMBER(obd_statfs, os_spare4);
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_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);
}
CHECK_MEMBER(mdt_rec_create, cr_padding_4);
}
{
/* Wire protocol assertions generated by 'wirecheck'
* (make -C lustre/utils newwiretest)
{
/* Wire protocol assertions generated by 'wirecheck'
* (make -C lustre/utils newwiretest)
- * running on Linux rhel6 2.6.32 #1 SMP Mon Aug 20 00:36:28 EDT 2012 x86_64 x86_64 x86_64 GNU
+ * running on Linux chopin 2.6.32.wc #9 SMP Thu Feb 9 14:43:41 CST 2012 x86_64 x86_64 x86_64
* with gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC) */
* with gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC) */
CLASSERT(LDLM_MAX_TYPE == 14);
CLASSERT(LUSTRE_RES_ID_SEQ_OFF == 0);
CLASSERT(LUSTRE_RES_ID_VER_OID_OFF == 1);
CLASSERT(LDLM_MAX_TYPE == 14);
CLASSERT(LUSTRE_RES_ID_SEQ_OFF == 0);
CLASSERT(LUSTRE_RES_ID_VER_OID_OFF == 1);
- CLASSERT(LUSTRE_RES_ID_QUOTA_SEQ_OFF == 2);
- CLASSERT(LUSTRE_RES_ID_QUOTA_VER_OID_OFF == 3);
+ CLASSERT(LUSTRE_RES_ID_QUOTA_SEQ_OFF == 2);
+ CLASSERT(LUSTRE_RES_ID_QUOTA_VER_OID_OFF == 3);
CLASSERT(LUSTRE_RES_ID_HSH_OFF == 3);
CLASSERT(LUSTRE_RES_ID_HSH_OFF == 3);
- CLASSERT(LQUOTA_TYPE_USR == 0);
- CLASSERT(LQUOTA_TYPE_GRP == 1);
- CLASSERT(LQUOTA_RES_MD == 1);
- CLASSERT(LQUOTA_RES_DT == 2);
+ CLASSERT(LQUOTA_TYPE_USR == 0);
+ CLASSERT(LQUOTA_TYPE_GRP == 1);
+ CLASSERT(LQUOTA_RES_MD == 1);
+ CLASSERT(LQUOTA_RES_DT == 2);
LASSERTF(OBD_PING == 400, "found %lld\n",
(long long)OBD_PING);
LASSERTF(OBD_LOG_CANCEL == 401, "found %lld\n",
LASSERTF(OBD_PING == 400, "found %lld\n",
(long long)OBD_PING);
LASSERTF(OBD_LOG_CANCEL == 401, "found %lld\n",
(long long)LDF_COLLIDE);
LASSERTF(LU_PAGE_SIZE == 4096, "found %lld\n",
(long long)LU_PAGE_SIZE);
(long long)LDF_COLLIDE);
LASSERTF(LU_PAGE_SIZE == 4096, "found %lld\n",
(long long)LU_PAGE_SIZE);
- LASSERTF((int)sizeof(union lu_page) == 4096, "found %lld\n",
- (long long)(int)sizeof(union lu_page));
+ /* Checks for union lu_page */
+ LASSERTF((int)sizeof(union lu_page) == 4096, "found %lld\n",
+ (long long)(int)sizeof(union lu_page));
/* Checks for struct lustre_handle */
LASSERTF((int)sizeof(struct lustre_handle) == 8, "found %lld\n",
/* Checks for struct lustre_handle */
LASSERTF((int)sizeof(struct lustre_handle) == 8, "found %lld\n",
OBD_CONNECT_LVB_TYPE);
LASSERTF(OBD_CONNECT_NANOSEC_TIME == 0x800000000000ULL, "found 0x%.16llxULL\n",
OBD_CONNECT_NANOSEC_TIME);
OBD_CONNECT_LVB_TYPE);
LASSERTF(OBD_CONNECT_NANOSEC_TIME == 0x800000000000ULL, "found 0x%.16llxULL\n",
OBD_CONNECT_NANOSEC_TIME);
- LASSERTF(OBD_CONNECT_LIGHTWEIGHT == 0x1000000000000ULL, "found 0x%.16llxULL\n",
+ LASSERTF(OBD_CONNECT_LIGHTWEIGHT == 0x1000000000000ULL, "found 0x%.16llxULL\n",
OBD_CONNECT_LIGHTWEIGHT);
OBD_CONNECT_LIGHTWEIGHT);
- LASSERTF(OBD_CONNECT_SHORTIO == 0x2000000000000ULL, "found 0x%.16llxULL\n",
- OBD_CONNECT_SHORTIO);
+ LASSERTF(OBD_CONNECT_SHORTIO == 0x2000000000000ULL, "found 0x%.16llxULL\n",
+ OBD_CONNECT_SHORTIO);
LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n",
(unsigned)OBD_CKSUM_CRC32);
LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n",
LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n",
(unsigned)OBD_CKSUM_CRC32);
LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n",
(long long)(int)offsetof(struct obd_statfs, os_state));
LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_state) == 4, "found %lld\n",
(long long)(int)sizeof(((struct obd_statfs *)0)->os_state));
(long long)(int)offsetof(struct obd_statfs, os_state));
LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_state) == 4, "found %lld\n",
(long long)(int)sizeof(((struct obd_statfs *)0)->os_state));
- LASSERTF((int)offsetof(struct obd_statfs, os_fprecreated) == 108, "found %lld\n",
- (long long)(int)offsetof(struct obd_statfs, os_fprecreated));
- LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_fprecreated) == 4, "found %lld\n",
- (long long)(int)sizeof(((struct obd_statfs *)0)->os_fprecreated));
+ LASSERTF((int)offsetof(struct obd_statfs, os_fprecreated) == 108, "found %lld\n",
+ (long long)(int)offsetof(struct obd_statfs, os_fprecreated));
+ LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_fprecreated) == 4, "found %lld\n",
+ (long long)(int)sizeof(((struct obd_statfs *)0)->os_fprecreated));
LASSERTF((int)offsetof(struct obd_statfs, os_spare2) == 112, "found %lld\n",
(long long)(int)offsetof(struct obd_statfs, os_spare2));
LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_spare2) == 4, "found %lld\n",
LASSERTF((int)offsetof(struct obd_statfs, os_spare2) == 112, "found %lld\n",
(long long)(int)offsetof(struct obd_statfs, os_spare2));
LASSERTF((int)sizeof(((struct obd_statfs *)0)->os_spare2) == 4, "found %lld\n",
LASSERTF((int)sizeof(union lquota_id) == 16, "found %lld\n",
(long long)(int)sizeof(union lquota_id));
LASSERTF((int)sizeof(union lquota_id) == 16, "found %lld\n",
(long long)(int)sizeof(union lquota_id));
- LASSERTF(QUOTABLOCK_BITS == 10, "found %lld\n",
- (long long)QUOTABLOCK_BITS);
- LASSERTF(QUOTABLOCK_SIZE == 1024, "found %lld\n",
- (long long)QUOTABLOCK_SIZE);
+ LASSERTF(QUOTABLOCK_BITS == 10, "found %lld\n",
+ (long long)QUOTABLOCK_BITS);
+ LASSERTF(QUOTABLOCK_SIZE == 1024, "found %lld\n",
+ (long long)QUOTABLOCK_SIZE);
/* Checks for struct obd_quotactl */
LASSERTF((int)sizeof(struct obd_quotactl) == 112, "found %lld\n",
/* Checks for struct obd_quotactl */
LASSERTF((int)sizeof(struct obd_quotactl) == 112, "found %lld\n",
(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));
(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",
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 lquota_lvb, lvb_id_rel));
LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_id_rel) == 8, "found %lld\n",
(long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_id_rel));
(long long)(int)offsetof(struct lquota_lvb, lvb_id_rel));
LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_id_rel) == 8, "found %lld\n",
(long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_id_rel));
- LASSERTF(LQUOTA_FL_EDQUOT == 1, "found %lld\n",
- (long long)LQUOTA_FL_EDQUOT);
LASSERTF((int)offsetof(struct lquota_lvb, lvb_id_qunit) == 24, "found %lld\n",
(long long)(int)offsetof(struct lquota_lvb, lvb_id_qunit));
LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_id_qunit) == 8, "found %lld\n",
LASSERTF((int)offsetof(struct lquota_lvb, lvb_id_qunit) == 24, "found %lld\n",
(long long)(int)offsetof(struct lquota_lvb, lvb_id_qunit));
LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_id_qunit) == 8, "found %lld\n",
(long long)(int)offsetof(struct lquota_lvb, lvb_pad1));
LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_pad1) == 8, "found %lld\n",
(long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_pad1));
(long long)(int)offsetof(struct lquota_lvb, lvb_pad1));
LASSERTF((int)sizeof(((struct lquota_lvb *)0)->lvb_pad1) == 8, "found %lld\n",
(long long)(int)sizeof(((struct lquota_lvb *)0)->lvb_pad1));
+ LASSERTF(LQUOTA_FL_EDQUOT == 1, "found %lld\n",
+ (long long)LQUOTA_FL_EDQUOT);
/* Checks for struct ldlm_gl_lquota_desc */
LASSERTF((int)sizeof(struct ldlm_gl_lquota_desc) == 64, "found %lld\n",
/* Checks for struct ldlm_gl_lquota_desc */
LASSERTF((int)sizeof(struct ldlm_gl_lquota_desc) == 64, "found %lld\n",