]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: use provided mode, or mask against current->fs->umask, on path_lookup_open...
authorSage Weil <sage@newdream.net>
Mon, 7 Apr 2008 21:31:20 +0000 (14:31 -0700)
committerSage Weil <sage@newdream.net>
Mon, 7 Apr 2008 21:31:20 +0000 (14:31 -0700)
src/kernel/dir.c
src/kernel/file.c
src/kernel/super.h

index 5cac51d7f4ae6de1df972766bdf0ae0a4ffc5eed..ea7df234633ad52219cf79c2c5f8ac524e57c7e6 100644 (file)
@@ -248,7 +248,8 @@ static struct dentry *ceph_dir_lookup(struct inode *dir, struct dentry *dentry,
        /* open (but not create!) intent? */
        if (nd->flags & LOOKUP_OPEN &&
            !(nd->intent.open.flags & O_CREAT)) {
-               err = ceph_lookup_open(dir, dentry, nd);
+               int mode = nd->intent.open.create_mode & ~current->fs->umask;
+               err = ceph_lookup_open(dir, dentry, nd, mode);
                return ERR_PTR(err);
        }
 
@@ -268,7 +269,7 @@ static int ceph_dir_create(struct inode *dir, struct dentry *dentry, int mode,
        dout(5, "create in dir %p dentry %p name '%.*s'\n",
             dir, dentry, dentry->d_name.len, dentry->d_name.name);
        BUG_ON((nd->flags & LOOKUP_OPEN) == 0);
-       err = ceph_lookup_open(dir, dentry, nd);
+       err = ceph_lookup_open(dir, dentry, nd, mode);
        return err;
 }
 
index e18b54a2cdac77eb1179c03cc1558046f721408a..48e30465b2ea869e8f05adc558aa3354daa35304 100644 (file)
@@ -106,7 +106,7 @@ int ceph_open(struct inode *inode, struct file *file)
  *  path_lookup_create -> LOOKUP_OPEN|LOOKUP_CREATE
  */
 int ceph_lookup_open(struct inode *dir, struct dentry *dentry,
-                    struct nameidata *nd)
+                    struct nameidata *nd, int mode)
 {
        struct ceph_client *client = ceph_sb_to_client(dir->i_sb);
        struct ceph_mds_client *mdsc = &client->mdsc;
@@ -114,7 +114,6 @@ int ceph_lookup_open(struct inode *dir, struct dentry *dentry,
        struct ceph_mds_request *req;
        int err;
        int flags = nd->intent.open.flags;
-       int mode = nd->intent.open.create_mode;
        dout(5, "ceph_lookup_open dentry %p '%.*s' flags %d mode 0%o\n", 
             dentry, dentry->d_name.len, dentry->d_name.name, flags, mode);
        
index cbf22bccd84b03b4b542aa73f03e3cd9e75b6a43..f20d926ca795fdfcc1c35b54fdafade671a9d6d2 100644 (file)
@@ -394,7 +394,7 @@ extern const struct file_operations ceph_file_fops;
 extern const struct address_space_operations ceph_aops;
 extern int ceph_open(struct inode *inode, struct file *file);
 extern int ceph_lookup_open(struct inode *dir, struct dentry *dentry,
-                           struct nameidata *nd);
+                           struct nameidata *nd, int mode);
 extern int ceph_release(struct inode *inode, struct file *filp);
 extern int ceph_inode_revalidate(struct inode *inode, int mask);