Whamcloud - gitweb
- various fixes from b1_5
authoryury <yury>
Wed, 18 Oct 2006 08:52:07 +0000 (08:52 +0000)
committeryury <yury>
Wed, 18 Oct 2006 08:52:07 +0000 (08:52 +0000)
lustre/llite/file.c
lustre/obdclass/obd_mount.c
lustre/obdfilter/filter.c
lustre/obdfilter/filter_io_24.c
lustre/ptlrpc/pack_generic.c
lustre/utils/mkfs_lustre.c
lustre/utils/obd.c

index 100f956..49cd749 100644 (file)
@@ -510,8 +510,7 @@ int ll_file_open(struct inode *inode, struct file *file)
         }
         down(&lli->lli_och_sem);
         if (*och_p) { /* Open handle is present */
-                if (it_disposition(it, DISP_LOOKUP_POS) && /* Positive lookup */
-                    it_disposition(it, DISP_OPEN_OPEN)) { /* & OPEN happened */
+                if (it_disposition(it, DISP_OPEN_OPEN)) {
                         /* Well, there's extra open request that we do not need,
                            let's close it somehow. This will decref request. */
                         ll_release_openhandle(file->f_dentry, it);
index d4f8781..58c4672 100644 (file)
@@ -1330,14 +1330,19 @@ static struct vfsmount *server_kernel_mount(struct super_block *sb)
         mnt = do_kern_mount("ldiskfs", s_flags, lmd->lmd_dev, 0);
         if (IS_ERR(mnt)) {
                 rc = PTR_ERR(mnt);
-                CERROR("premount ldiskfs failed (%d), trying ext3\n", rc);
-                /* If ldisk fails, try ext3 */
+                CERROR("premount ldiskfs failed (%d), is the ldiskfs module "
+                       "available?\n", rc);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
+                GOTO(out_free, rc);
+#else
+                /* If ldiskfs fails, try ext3 */
                 mnt = do_kern_mount("ext3", s_flags, lmd->lmd_dev, 0);
                 if (IS_ERR(mnt)) {
                         rc = PTR_ERR(mnt);
                         CERROR("premount ext3 failed: rc = %d\n", rc);
                         GOTO(out_free, rc);
                 }
+#endif
         }
 
         OBD_SET_CTXT_MAGIC(&mount_ctxt);
index 5fb77d9..8441532 100644 (file)
@@ -2819,6 +2819,7 @@ int filter_setattr_internal(struct obd_export *exp, struct dentry *dentry,
         }
 
         if (ia_valid & ATTR_SIZE || ia_valid & (ATTR_UID | ATTR_GID)) {
+                DQUOT_INIT(inode);
                 LOCK_INODE_MUTEX(inode);
                 locked = 1;
         }
@@ -3492,6 +3493,7 @@ int filter_destroy(struct obd_export *exp, struct obdo *oa,
                 if (fcc != NULL)
                         memcpy(fcc, obdo_logcookie(oa), sizeof(*fcc));
         }
+        DQUOT_INIT(dchild->d_inode);
 
         /* we're gonna truncate it first in order to avoid possible deadlock:
          *      P1                      P2
index 314481b..a555477 100644 (file)
@@ -455,6 +455,8 @@ int filter_commitrw_write(struct obd_export *exp, struct obdo *oa, int objcount,
         push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
         cleanup_phase = 2;
 
+        DQUOT_INIT(inode);
+        
         down(&inode->i_sem);
         oti->oti_handle = fsfilt_brw_start(obd, objcount, &fso, niocount, res,
                                            oti);
index 9bd9388..47faddc 100644 (file)
@@ -671,11 +671,11 @@ static int lustre_unpack_msg_v2(struct lustre_msg_v2 *m, int len)
 {
         int flipped, required_len, i;
 
-        required_len = lustre_msg_hdr_size_v2(m->lm_bufcount);
+        /* Now we know the sender speaks my language. */
+        required_len = lustre_msg_hdr_size_v2(0);
         if (len < required_len) {
-                /* didn't receive all the buffer lengths */
-                CERROR ("message length %d too small for %d buflens\n",
-                        len, m->lm_bufcount);
+                /* can't even look inside the message */
+                CERROR("message length %d too small for lustre_msg\n", len);
                 return -EINVAL;
         }
 
@@ -687,6 +687,14 @@ static int lustre_unpack_msg_v2(struct lustre_msg_v2 *m, int len)
                 __swab32s(&m->lm_repsize);
         }
 
+        required_len = lustre_msg_hdr_size_v2(m->lm_bufcount);
+        if (len < required_len) {
+                /* didn't receive all the buffer lengths */
+                CERROR ("message length %d too small for %d buflens\n",
+                        len, m->lm_bufcount);
+                return -EINVAL;
+        }
+        
         for (i = 0; i < m->lm_bufcount; i++) {
                 if (flipped)
                         __swab32s(&m->lm_buflens[i]);
index 7f5ab64..3aca10f 100644 (file)
@@ -1388,8 +1388,7 @@ int main(int argc, char *argv[])
 
         if ((argc < 2) || (argv[argc - 1][0] == '-')) {
                 usage(stderr);
-                ret = EINVAL;
-                goto out;
+                return(EINVAL);
         }
 
         memset(&mop, 0, sizeof(mop));
index 6d8be40..ac9b251 100644 (file)
@@ -159,12 +159,13 @@ int lcfg_mgs_ioctl(char *func, int dev_id, struct lustre_cfg *lcfg)
 {
         struct obd_ioctl_data data;
         static int mgs_device = -1;
+        char mgs[] = "$MGS";
         int rc;
 
         /* Always operates on MGS dev */
         if (mgs_device == -1) {
                 do_disconnect(NULL, 1);
-                rc = do_device("mgsioc", "MGS");
+                rc = do_device("mgsioc", mgs);
                 if (rc) {
                         errno = ENODEV;
                         return -1;
@@ -248,7 +249,7 @@ int parse_devname(char *func, char *name)
                 rc = do_name2dev(func, name);
                 if (rc >= N2D_OFF) {
                         ret = rc - N2D_OFF;
-                        printf("Name %s is device %d\n", name, ret);
+                        // printf("Name %s is device %d\n", name, ret);
                 } else {
                         printf("No device found for name %s: %s\n",
                                name, strerror(rc));
@@ -593,11 +594,8 @@ extern command_t cmdlist[];
 
 static int do_device(char *func, char *devname)
 {
-        struct obd_ioctl_data data;
         int dev;
 
-        memset(&data, 0, sizeof(data));
-
         dev = parse_devname(func, devname);
         if (dev < 0)
                 return -1;