Whamcloud - gitweb
- fixed objects creating on OST with correct uid and gid on setattr path.
authoryury <yury>
Tue, 13 Sep 2005 07:56:47 +0000 (07:56 +0000)
committeryury <yury>
Tue, 13 Sep 2005 07:56:47 +0000 (07:56 +0000)
- removed not needed prototype from filter_internal.h
- removed uid/gid stuff from filter_preprw_write() as it is not used there.

lustre/obdfilter/filter.c
lustre/obdfilter/filter_internal.h
lustre/obdfilter/filter_io.c

index 3f46dc0..492db29 100644 (file)
@@ -2316,6 +2316,8 @@ int filter_create_object(struct obd_device *obd, struct obdo *oa)
         int err = 0, rc = 0;
         void *handle = NULL;
         void *lock = NULL;
+       obd_uid uid;
+       obd_gid gid;
         ENTRY;
 
         filter = &obd->u.filter;
@@ -2349,10 +2351,13 @@ int filter_create_object(struct obd_device *obd, struct obdo *oa)
                 GOTO(cleanup, rc = PTR_ERR(handle));
         cleanup_phase = 3;
 
-        uc.luc_uid = oa->o_uid;
-        uc.luc_gid = oa->o_gid;
-        uc.luc_fsuid = oa->o_uid;
-        uc.luc_fsgid = oa->o_gid;
+        uid = oa->o_valid & OBD_MD_FLUID ? oa->o_uid : 0;
+        gid = oa->o_valid & OBD_MD_FLGID ? oa->o_gid : 0;
+        
+        uc.luc_uid = uid;
+        uc.luc_gid = gid;
+        uc.luc_fsuid = uid;
+        uc.luc_fsgid = gid;
         uc.luc_cap = current->cap_effective;
         cap_raise(uc.luc_cap, CAP_SYS_RESOURCE);
 
index 33b13a1..1164fc1 100644 (file)
@@ -95,7 +95,6 @@ struct dentry *__filter_oa2dentry(struct obd_device *obd, struct obdo *oa,
 #define filter_oa2dentry(obd, oa) __filter_oa2dentry(obd, oa, __FUNCTION__)
 
 int filter_finish_transno(struct obd_export *, struct obd_trans_info *, int rc);
-__u64 filter_next_id(struct filter_obd *, int group);
 __u64 filter_last_id(struct filter_obd *, int group);
 int filter_update_server_data(struct obd_device *, struct file *,
                               struct filter_server_data *, int force_sync);
index c986b2c..75c4b51 100644 (file)
@@ -513,8 +513,6 @@ static int filter_preprw_write(int cmd, struct obd_export *exp, struct obdo *oa,
         struct niobuf_remote *rnb;
         struct fsfilt_objinfo fso;
         obd_size left;
-        obd_uid uid;
-        obd_gid gid;
         void *iobuf; 
         
         ENTRY;
@@ -531,9 +529,6 @@ static int filter_preprw_write(int cmd, struct obd_export *exp, struct obdo *oa,
         obd = exp->exp_obd;
         push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
 
-        uid = oa->o_valid & OBD_MD_FLUID ? oa->o_uid : 0;
-        gid = oa->o_valid & OBD_MD_FLGID ? oa->o_gid : 0;
-        
         /* make sure that object is already allocated */
         dentry = filter_crow_object(obd, oa);
         if (IS_ERR(dentry))