down(&lli->lli_och_sem);
if (*och_p) { /* Open handle is present */
- if (LUSTRE_IT(it)->it_disposition) {
+ if (it_disposition(it, DISP_LOOKUP_POS) && /* Positive lookup */
+ it_disposition(it, DISP_OPEN_OPEN)) { /* & OPEN happened */
struct obd_client_handle *och;
/* Well, there's extra open request that we do not need,
let's close it somehow*/
if (!exp || !exp->exp_obd)
RETURN(-ENODEV);
+ LASSERT(!(src_oa->o_valid & ~(OBD_MD_FLID|OBD_MD_FLTYPE | OBD_MD_FLMODE|
+ OBD_MD_FLATIME | OBD_MD_FLMTIME |
+ OBD_MD_FLCTIME | OBD_MD_FLFLAGS |
+ OBD_MD_FLSIZE | OBD_MD_FLGROUP |
+ OBD_MD_FLUID | OBD_MD_FLGID)));
+
LASSERT(!(src_oa->o_valid & OBD_MD_FLGROUP) || src_oa->o_gr > 0);
lov = &exp->exp_obd->u.lov;
down(&ctxt->loc_objects_dir->d_inode->i_sem);
fdentry = lookup_one_len(id_name, ctxt->loc_objects_dir,
id_len);
- if (fdentry == NULL || fdentry->d_inode == NULL) {
+ if (IS_ERR(fdentry) || fdentry->d_inode == NULL) {
CERROR("destroy non_existent object %s\n",
id_name);
GOTO(out_err, rc = IS_ERR(fdentry) ?
old_dentry = lookup_one_len(old_nd.last.name, old_dparent,
old_nd.last.len);
- if (!old_dentry || !old_dentry->d_inode ||
+ if (IS_ERR(old_dentry) || !old_dentry->d_inode ||
is_bad_inode(old_dentry->d_inode))
GOTO(cleanup, rc = -ENODEV);
if (dir->i_rdev != old_dentry->d_inode->i_rdev)
dir = dparent->d_inode;
dentry = lookup_one_len(nd.last.name, dparent, nd.last.len);
- if (!dentry || !dentry->d_inode || is_bad_inode(dentry->d_inode))
+ if (IS_ERR(dentry) || !dentry->d_inode || is_bad_inode(dentry->d_inode))
GOTO(cleanup, rc = -ENODEV);
if (!SMFS_DO_WRITE_KML(r_rec->u_rec.ur_flags))
dir = dparent->d_inode;
dentry = lookup_one_len(nd.last.name, dparent, nd.last.len);
- if (!dentry || !dentry->d_inode || is_bad_inode(dentry->d_inode)) {
+ if (IS_ERR(dentry) || !dentry->d_inode || is_bad_inode(dentry->d_inode)) {
path_release(&nd);
RETURN(rc);
}
dir = dparent->d_inode;
dentry = lookup_one_len(nd.last.name, dparent, nd.last.len);
- if (!dentry || !dentry->d_inode || is_bad_inode(dentry->d_inode)) {
+ if (IS_ERR(dentry) || !dentry->d_inode || is_bad_inode(dentry->d_inode)) {
path_release(&nd);
RETURN(rc);
}
dir = dparent->d_inode;
dentry = lookup_one_len(nd.last.name, dparent, nd.last.len);
- if (!dentry || !dentry->d_inode || is_bad_inode(dentry->d_inode)) {
+ if (IS_ERR(dentry) || !dentry->d_inode || is_bad_inode(dentry->d_inode)) {
path_release(&nd);
RETURN(rc);
}
OBD_ALLOC(lcfg, data->ioc_plen1);
err = copy_from_user(lcfg, data->ioc_pbuf1, data->ioc_plen1);
- if (err)
- GOTO(out, err);
-
- err = class_process_config(lcfg);
+ if (!err)
+ err = class_process_config(lcfg);
OBD_FREE(lcfg, data->ioc_plen1);
GOTO(out, err);
}
static int filter_setup(struct obd_device *obd, obd_count len, void *buf)
{
- struct lustre_cfg* lcfg = buf;
struct filter_obd *filter = &obd->u.filter;
+ struct lustre_cfg *lcfg = buf;
+ unsigned long page;
int rc;
ENTRY;
spin_lock_init(&filter->fo_denylist_lock);
INIT_LIST_HEAD(&filter->fo_denylist);
+ /* 2.6.9 selinux wants a full option page for do_kern_mount (bug6471) */
+ page = get_zeroed_page(GFP_KERNEL);
+ if (!page)
+ RETURN(-ENOMEM);
+
+ memcpy((void *)page, lustre_cfg_buf(lcfg, 4),
+ LUSTRE_CFG_BUFLEN(lcfg, 4));
+
/* all mount options including errors=remount-ro and asyncdel are passed
* using 4th lcfg param. And it is good, finally we have got rid of
* hardcoded fs types in the code. */
- rc = filter_common_setup(obd, len, buf, lustre_cfg_buf(lcfg, 4));
+ rc = filter_common_setup(obd, len, buf, (void *)page);
+ free_page(page);
+
if (rc)
RETURN(rc);
rc = filter_post_fs_setup(obd);
if (dentry->d_inode == NULL) {
lvb->lvb_size = 0;
lvb->lvb_blocks = 0;
- lvb->lvb_mtime = LTIME_S(CURRENT_TIME);
+
+ /* making client use MDS mtime as this one is zero, bigger one
+ * will be taken and this does not break POSIX. Thanks to
+ * Andreas. --umka */
+ lvb->lvb_mtime = 0;
} else {
lvb->lvb_size = dentry->d_inode->i_size;
lvb->lvb_blocks = dentry->d_inode->i_blocks;
/* sanobd setup methods - use a specific mount option */
int filter_san_setup(struct obd_device *obd, obd_count len, void *buf)
{
- struct lustre_cfg* lcfg = buf;
- char *option = NULL;
-
- if (!lustre_cfg_buf(lcfg, 2))
+ struct lustre_cfg *lcfg = buf;
+ unsigned long page;
+ int rc;
+
+ if (lcfg->lcfg_bufcount < 3 || LUSTRE_CFG_BUFLEN(lcfg, 2) < 1)
RETURN(-EINVAL);
+ /* 2.6.9 selinux wants a full option page for do_kern_mount (bug6471) */
+ page = get_zeroed_page(GFP_KERNEL);
+ if (!page)
+ RETURN(-ENOMEM);
+
/* for extN/ext3 filesystem, we must mount it with 'writeback' mode */
- if (!strcmp(lustre_cfg_string(lcfg, 2), "extN"))
- option = "data=writeback";
+ if (!strcmp(lustre_cfg_string(lcfg, 2), "ldiskfs"))
+ strcpy((void *)page, "data=writeback");
else if (!strcmp(lustre_cfg_string(lcfg, 2), "ext3"))
- option = "data=writeback,asyncdel";
+ strcpy((void *)page, "data=writeback,asyncdel");
else
LBUG(); /* just a reminder */
- return filter_common_setup(obd, len, buf, option);
+ rc = filter_common_setup(obd, len, buf, (void *)page);
+ free_page(page);
+
+ return rc;
}
int filter_san_preprw(int cmd, struct obd_export *exp, struct obdo *oa,