struct vfsmount *e2_vfsmnt;
};
-struct obd_ucred {
+struct obd_ucred {
__u32 ouc_fsuid;
__u32 ouc_fsgid;
};
mm_segment_t fs;
__u32 fsuid;
__u32 fsgid;
+ __u32 override;
#ifdef OBD_CTXT_DEBUG
__u32 magic;
#endif
ENTRY;
if (flags & (LDLM_FL_BLOCK_WAIT | LDLM_FL_BLOCK_GRANTED |
- LDLM_FL_BLOCK_CONV)) {
+ LDLM_FL_BLOCK_CONV)) {
/* Go to sleep until the lock is granted. */
/* FIXME: or cancelled. */
LDLM_DEBUG(lock, "client-side enqueue returned a blocked lock,"
save->fs = get_fs();
save->pwd = dget(current->fs->pwd);
save->pwdmnt = mntget(current->fs->pwdmnt);
+ save->override = cap_raised(current->cap_effective, CAP_DAC_OVERRIDE);
LASSERT(save->pwd);
LASSERT(save->pwdmnt);
}
set_fs(new->fs);
set_fs_pwd(current->fs, new->pwdmnt, new->pwd);
+ if (save->override)
+ cap_lower(current->cap_effective, CAP_DAC_OVERRIDE);
}
void pop_ctxt(struct obd_run_ctxt *saved)
//printk("pc6\n");
current->fsuid = saved->fsuid;
current->fsgid = saved->fsgid;
+
+ if (saved->override)
+ cap_raise(current->cap_effective, CAP_DAC_OVERRIDE);
}
/* utility to make a file */
ino = lic.lic_body->fid1.id;
mode = lic.lic_body->mode;
if (it->it_op & (IT_CREAT | IT_MKDIR | IT_SYMLINK | IT_MKNOD)) {
- /* For create ops, we want the lookup to be negative */
- if (!it->it_status)
+ /* For create ops, we want the lookup to be negative,
+ * unless the create failed in a way that indicates
+ * that the file is already there */
+ if (it->it_status != -EEXIST)
GOTO(negative, NULL);
} else if (it->it_op & (IT_GETATTR | IT_SETATTR | IT_LOOKUP)) {
/* For check ops, we want the lookup to succeed */
}
it->it_data = dentry;
} else if (it->it_op & (IT_UNLINK | IT_RMDIR)) {
- /* For remove ops, we want the lookup to succeed */
+ /* For remove ops, we want the lookup to succeed unless
+ * the file truly doesn't exist */
it->it_data = NULL;
- if (it->it_status)
+ if (it->it_status == -ENOENT)
GOTO(neg_req, NULL);
goto iget;
} else if (it->it_op == IT_OPEN) {
push_ctxt(&saved, &mds->mds_ctxt, &uc);
de = mds_fid2dentry(mds, &body->fid1, NULL);
if (IS_ERR(de)) {
- req->rq_status = -ENOENT;
- rc = 0;
+ rc = req->rq_status = -ENOENT;
GOTO(out_pop, PTR_ERR(de));
}
mds_fs_set_last_rcvd(mds, handle);
rc = lustre_fwrite(mds->mds_rcvd_filp, (char *)mcd, sizeof(*mcd), &off);
- CDEBUG(D_INODE, "wrote trans #"LPD64" for client '%s' at #%d: rc = %d\n",
- last_rcvd, mcd->mcd_uuid, med->med_off, rc);
+ CDEBUG(D_INODE, "wrote trans #"LPD64" for client '%s' at #%d: rc = "
+ "%d\n", last_rcvd, mcd->mcd_uuid, med->med_off, rc);
if (rc == sizeof(*mcd))
rc = 0;
l_dput(de);
out_setattr:
req->rq_status = rc;
- return (0);
+ return 0;
}
static int mds_reint_recreate(struct mds_update_record *rec, int offset,
}
if (rc) {
- CERROR("error during create: %d\n", rc);
- if (rc != -ENOSPC)
- LBUG();
+ CDEBUG(D_INODE, "error during create: %d\n", rc);
GOTO(out_create_commit, rc);
} else {
struct iattr iattr;