Whamcloud - gitweb
Revert "LU-3544 nfs: writing to new files will return ENOENT"
[fs/lustre-release.git] / lustre / llite / file.c
index fb70eba..869998f 100644 (file)
@@ -393,6 +393,8 @@ static int ll_intent_file_open(struct file *file, void *lmm,
 {
         struct ll_sb_info *sbi = ll_i2sbi(file->f_dentry->d_inode);
         struct dentry *parent = file->f_dentry->d_parent;
+        const char *name = file->f_dentry->d_name.name;
+        const int len = file->f_dentry->d_name.len;
         struct md_op_data *op_data;
         struct ptlrpc_request *req;
         __u32 opc = LUSTRE_OPC_ANY;
@@ -417,10 +419,9 @@ static int ll_intent_file_open(struct file *file, void *lmm,
                         opc = LUSTRE_OPC_CREATE;
         }
 
-       op_data  = ll_prep_md_op_data(NULL, parent->d_inode,
-                                     file->f_dentry->d_inode, NULL, 0,
-                                     O_RDWR, opc, NULL);
-
+        op_data  = ll_prep_md_op_data(NULL, parent->d_inode,
+                                      file->f_dentry->d_inode, name, len,
+                                      O_RDWR, opc, NULL);
         if (IS_ERR(op_data))
                 RETURN(PTR_ERR(op_data));
 
@@ -1441,7 +1442,7 @@ static int ll_lov_recreate_obj(struct inode *inode, unsigned long arg)
        struct ost_id           oi;
        ENTRY;
 
-       if (!cfs_capable(CAP_SYS_ADMIN))
+       if (!cfs_capable(CFS_CAP_SYS_ADMIN))
                RETURN(-EPERM);
 
        if (copy_from_user(&ucreat, (struct ll_recreate_obj *)arg,
@@ -1460,7 +1461,7 @@ static int ll_lov_recreate_fid(struct inode *inode, unsigned long arg)
        obd_count       ost_idx;
         ENTRY;
 
-       if (!cfs_capable(CAP_SYS_ADMIN))
+       if (!cfs_capable(CFS_CAP_SYS_ADMIN))
                RETURN(-EPERM);
 
        if (copy_from_user(&fid, (struct lu_fid *)arg, sizeof(fid)))
@@ -1602,7 +1603,7 @@ static int ll_lov_setea(struct inode *inode, struct file *file,
        int                      rc;
        ENTRY;
 
-       if (!cfs_capable(CAP_SYS_ADMIN))
+       if (!cfs_capable(CFS_CAP_SYS_ADMIN))
                RETURN(-EPERM);
 
        OBD_ALLOC_LARGE(lump, lum_size);
@@ -1859,7 +1860,7 @@ int ll_fid2path(struct inode *inode, void *arg)
        int                      outsize, rc;
        ENTRY;
 
-       if (!cfs_capable(CAP_DAC_READ_SEARCH) &&
+       if (!cfs_capable(CFS_CAP_DAC_READ_SEARCH) &&
            !(ll_i2sbi(inode)->ll_flags & LL_SBI_USER_FID2PATH))
                RETURN(-EPERM);
 
@@ -2208,7 +2209,7 @@ static int ll_hsm_state_set(struct inode *inode, struct hsm_state_set *hss)
        /* Non-root users are forbidden to set or clear flags which are
         * NOT defined in HSM_USER_MASK. */
        if (((hss->hss_setmask | hss->hss_clearmask) & ~HSM_USER_MASK) &&
-           !cfs_capable(CAP_SYS_ADMIN))
+           !cfs_capable(CFS_CAP_SYS_ADMIN))
                RETURN(-EPERM);
 
        op_data = ll_prep_md_op_data(NULL, inode, NULL, NULL, 0, 0,