Whamcloud - gitweb
Land b1_4_smallfix onto b1_4 (20050210_1537)
authoradilger <adilger>
Thu, 10 Feb 2005 23:43:50 +0000 (23:43 +0000)
committeradilger <adilger>
Thu, 10 Feb 2005 23:43:50 +0000 (23:43 +0000)
- fix incorrect LASSERT in mds_getattr_name (5635)
- fix configure check for grab_cache_page_nowait_gfp
- fix lsattr -v for directories so we can get inode generation from userspace
- fix mtime return from glimpse AST reply again (4829)

17 files changed:
lustre/ChangeLog
lustre/autoconf/.cvsignore [new file with mode: 0644]
lustre/autoconf/lustre-core.m4
lustre/include/liblustre.h
lustre/include/linux/lustre_compat25.h
lustre/ldlm/ldlm_flock.c
lustre/ldlm/ldlm_lib.c
lustre/llite/dcache.c
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/namei.c
lustre/lov/lov_request.c
lustre/lvfs/.cvsignore
lustre/mdc/mdc_locks.c
lustre/mds/handler.c
lustre/mds/mds_fs.c
lustre/utils/lconf

index b82fdf3..6cd4c56 100644 (file)
@@ -20,6 +20,7 @@ tbd         Cluster File Systems, Inc. <info@clusterfs.com>
        - look up hostnames for IB nals (5602)
        - 2.6 changed lock ordering of 2 semaphores, caused deadlock (5654)
        - don't start multiple acceptors for the same port (5277)
+       - fix incorrect LASSERT in mds_getattr_name (5635)
        * miscellania
        - service request history (4965)
        - put {ll,lov,osc}_async_page structs in a single slab (4699)
@@ -207,7 +208,7 @@ tbd         Cluster File Systems, Inc. <info@clusterfs.com>
        - don't do DNS lookups on NIDs too small for IP addresses (3442)
        - re-awaken ptlrpcd if new requests arrive during check_set  (3554)
        - fix cond_resched  (3554)
-       - only evict unfinished clients after recovery   (3515)
+       - only evict unfinished clients after recovery (3515)
        - allow bulk resend, prevent data loss (3570)
        - dynamic ptlrpc request buffer allocation (2102)
        - don't allow unlinking open directory if it isn't empty (2904)
diff --git a/lustre/autoconf/.cvsignore b/lustre/autoconf/.cvsignore
new file mode 100644 (file)
index 0000000..282522d
--- /dev/null
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
index f09a05b..c816f62 100644 (file)
@@ -249,18 +249,16 @@ LB_LINUX_TRY_COMPILE([
 # check for our patched grab_cache_page_nowait_gfp() function
 #
 AC_DEFUN([LC_FUNC_GRAB_CACHE_PAGE_NOWAIT_GFP],
-[
-LB_LINUX_TRY_COMPILE([
-       #include <linux/pagemap.h>
-],[
-       grab_cache_page_nowait_gfp(NULL, 0, 0);
-],[
-       AC_MSG_RESULT([yes])
+[AC_MSG_CHECKING([if kernel defines grab_cache_page_nowait_gfp()])
+HAVE_GCPN_GFP="`grep -c 'grab_cache_page_nowait_gfp' $LINUX/mm/filemap.c`"
+if test "$HAVE_GCPN_GFP" != 0 ; then
        AC_DEFINE(HAVE_GRAB_CACHE_PAGE_NOWAIT_GFP, 1,
                [kernel has grab_cache_page_nowait_gfp()])
-],[
-       AC_MSG_RESULT([no])
-])])
+       AC_MSG_RESULT(yes)
+else
+       AC_MSG_RESULT(no)
+fi
+])
 
 #
 # LC_CONFIG_BACKINGFS
index 8022711..bbadd08 100644 (file)
@@ -293,8 +293,9 @@ static inline void spin_unlock_irqrestore(spinlock_t *a, unsigned long b) {}
 #endif
 
 /* registering symbols */
-
+#ifndef ERESTARTSYS
 #define ERESTARTSYS ERESTART
+#endif
 #define HZ 1
 
 /* random */
index 8e78e2e..d3770b6 100644 (file)
@@ -256,6 +256,12 @@ static inline int mapping_has_pages(struct address_space *mapping)
 }
 #endif
 
+#ifdef HAVE_KIOBUF_KIO_BLOCKS
+#define KIOBUF_GET_BLOCKS(k) ((k)->kio_blocks)
+#else
+#define KIOBUF_GET_BLOCKS(k) ((k)->blocks)
+#endif
+
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,7))
 #define ll_set_dflags(dentry, flags) do { dentry->d_vfs_flags |= flags; } while(0)
 #define ll_vfs_symlink(dir, dentry, path, mode) vfs_symlink(dir, dentry, path)
@@ -295,7 +301,7 @@ static inline int mapping_has_pages(struct address_space *mapping)
 #endif
 
 #ifndef HAVE_GRAB_CACHE_PAGE_NOWAIT_GFP
-#define grab_cache_page_nowait_gfp(x, y, z) (grab_cache_page_nowait((x), (y)))
+#define grab_cache_page_nowait_gfp(x, y, z) grab_cache_page_nowait((x), (y))
 #endif
 
 #endif /* __KERNEL__ */
index 7035f04..f4d660a 100644 (file)
@@ -424,7 +424,6 @@ ldlm_flock_interrupted_wait(void *data)
 {
         struct ldlm_lock *lock;
         struct lustre_handle lockh;
-        int rc;
         ENTRY;
 
         lock = ((struct ldlm_flock_wait_data *)data)->fwd_lock;
@@ -434,7 +433,7 @@ ldlm_flock_interrupted_wait(void *data)
 
         ldlm_lock_decref_internal(lock, lock->l_req_mode);
         ldlm_lock2handle(lock, &lockh);
-        rc = ldlm_cli_cancel(&lockh);
+        ldlm_cli_cancel(&lockh);
         EXIT;
 }
 
@@ -549,7 +548,7 @@ int ldlm_flock_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
         LASSERT(flag == LDLM_CB_CANCELING);
 
         ns = lock->l_resource->lr_namespace;
-        
+
         /* take lock off the deadlock detection waitq. */
         l_lock(&ns->ns_lock);
         list_del_init(&lock->l_flock_waitq);
index ee72a55..1e417e3 100644 (file)
@@ -404,7 +404,7 @@ int target_handle_connect(struct ptlrpc_request *req, svc_handler_t handler)
         if (!target) {
                 target = class_name2obd(str);
         }
-        
+
         if (!target || target->obd_stopping || !target->obd_set_up) {
                 CERROR("UUID '%s' is not available for connect\n", str);
                 GOTO(out, rc = -ENODEV);
@@ -936,7 +936,7 @@ int target_queue_recovery_request(struct ptlrpc_request *req,
 
         /* A resent, replayed request that is still on the queue; just drop it.
            The queued request will handle this. */
-        if ((lustre_msg_get_flags(req->rq_reqmsg) & (MSG_RESENT | MSG_REPLAY)) ==
+        if ((lustre_msg_get_flags(req->rq_reqmsg) & (MSG_RESENT|MSG_REPLAY)) ==
             (MSG_RESENT | MSG_REPLAY)) {
                 DEBUG_REQ(D_ERROR, req, "dropping resent queued req");
                 spin_unlock_bh(&obd->obd_processing_task_lock);
@@ -1179,7 +1179,7 @@ void target_committed_to_req(struct ptlrpc_request *req)
                 DEBUG_REQ(D_IOCTL, req,
                           "not sending last_committed update");
 
-        CDEBUG(D_INFO, "last_committed "LPU64", xid "LPX64"\n",
+        CDEBUG(D_INFO, "last_committed "LPU64", xid "LPU64"\n",
                obd->obd_last_committed, req->rq_xid);
 }
 EXPORT_SYMBOL(target_committed_to_req);
index 03d9f23..9dcacc9 100644 (file)
@@ -256,7 +256,8 @@ void ll_frob_intent(struct lookup_intent **itp, struct lookup_intent *deft)
         it->it_op_release = ll_intent_release;
 }
 
-int ll_revalidate_it(struct dentry *de, int flags, struct lookup_intent *it)
+int ll_revalidate_it(struct dentry *de, int lookup_flags,
+                     struct lookup_intent *it)
 {
         int rc;
         struct ll_fid pfid, cfid;
@@ -293,7 +294,7 @@ int ll_revalidate_it(struct dentry *de, int flags, struct lookup_intent *it)
 
         rc = mdc_intent_lock(exp, &ctxt, &pfid, de->d_name.name, de->d_name.len,
                              NULL, 0,
-                             &cfid, it, flags, &req, ll_mdc_blocking_ast);
+                             &cfid, it, lookup_flags, &req,ll_mdc_blocking_ast);
         /* If req is NULL, then mdc_intent_lock only tried to do a lock match;
          * if all was well, it will return 1 if it found locks, 0 otherwise. */
         if (req == NULL && rc >= 0)
index d8c4688..eb4703e 100644 (file)
@@ -385,6 +385,15 @@ static int ll_dir_ioctl(struct inode *inode, struct file *file,
         case EXT3_IOC_GETFLAGS:
         case EXT3_IOC_SETFLAGS:
                 RETURN(ll_iocontrol(inode, file, cmd, arg));
+        case EXT3_IOC_GETVERSION_OLD:
+        case EXT3_IOC_GETVERSION:
+                RETURN(put_user(inode->i_generation, (int *)arg));
+        /* We need to special case any other ioctls we want to handle,
+         * to send them to the MDS/OST as appropriate and to properly
+         * network encode the arg field.
+        case EXT3_IOC_SETVERSION_OLD:
+        case EXT3_IOC_SETVERSION:
+        */
         case IOC_MDC_LOOKUP: {
                 struct ptlrpc_request *request = NULL;
                 struct ll_fid fid;
@@ -491,7 +500,7 @@ static int ll_dir_ioctl(struct inode *inode, struct file *file,
                 EXIT;
         out_get:
                 ptlrpc_req_finished(request);
-                RETURN(rc);
+                return rc;
         }
         case IOC_MDC_GETFILEINFO:
         case IOC_MDC_GETSTRIPE: {
index daf9669..801f3d7 100644 (file)
@@ -1083,10 +1083,10 @@ int ll_file_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
                 RETURN(ll_lov_recreate_obj(inode, file, arg));
         case EXT3_IOC_GETFLAGS:
         case EXT3_IOC_SETFLAGS:
-                RETURN( ll_iocontrol(inode, file, cmd, arg) );
+                RETURN(ll_iocontrol(inode, file, cmd, arg));
         case EXT3_IOC_GETVERSION_OLD:
         case EXT3_IOC_GETVERSION:
-                return put_user(inode->i_generation, (int *) arg);
+                RETURN(put_user(inode->i_generation, (int *) arg));
         /* We need to special case any other ioctls we want to handle,
          * to send them to the MDS/OST as appropriate and to properly
          * network encode the arg field.
@@ -1094,8 +1094,8 @@ int ll_file_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
         case EXT2_IOC_SETVERSION_NEW:
         */
         default:
-                RETURN( obd_iocontrol(cmd, ll_i2obdexp(inode), 0, NULL,
-                                      (void *)arg) );
+                RETURN(obd_iocontrol(cmd, ll_i2obdexp(inode), 0, NULL,
+                                     (void *)arg));
         }
 }
 
index a024df2..a56a31d 100644 (file)
@@ -232,8 +232,7 @@ static void ll_d_add(struct dentry *de, struct inode *inode)
         if (!d_unhashed(de)) {
                 spin_unlock(&dcache_lock);
                 CERROR("dentry %.*s %p hash next %p\n",
-                       de->d_name.len, de->d_name.name, de,
-                       de->d_hash.next);
+                       de->d_name.len, de->d_name.name, de, de->d_hash.next);
                 LBUG();
         }
         __d_rehash(de, 0);
index 8aa4165..01fd978 100644 (file)
@@ -130,6 +130,7 @@ int lov_update_enqueue_set(struct lov_request_set *set,
 
                 LASSERT(lock != NULL);
                 loi->loi_rss = tmp;
+                loi->loi_mtime = req->rq_md->lsm_oinfo->loi_mtime;
                 loi->loi_blocks = req->rq_md->lsm_oinfo->loi_blocks;
                 /* Extend KMS up to the end of this lock and no further
                  * A lock on [x,y] means a KMS of up to y + 1 bytes! */
@@ -151,6 +152,7 @@ int lov_update_enqueue_set(struct lov_request_set *set,
         } else if (rc == ELDLM_LOCK_ABORTED && flags & LDLM_FL_HAS_INTENT) {
                 memset(lov_lockhp, 0, sizeof(*lov_lockhp));
                 loi->loi_rss = req->rq_md->lsm_oinfo->loi_rss;
+                loi->loi_mtime = req->rq_md->lsm_oinfo->loi_mtime;
                 loi->loi_blocks = req->rq_md->lsm_oinfo->loi_blocks;
                 CDEBUG(D_INODE, "glimpsed, setting rss="LPU64"; leaving"
                        " kms="LPU64"\n", loi->loi_rss, loi->loi_kms);
@@ -286,6 +288,7 @@ int lov_prep_enqueue_set(struct obd_export *exp, struct lov_stripe_md *lsm,
                 req->rq_md->lsm_oinfo->loi_rss = loi->loi_rss;
                 req->rq_md->lsm_oinfo->loi_kms = loi->loi_kms;
                 req->rq_md->lsm_oinfo->loi_blocks = loi->loi_blocks;
+                req->rq_md->lsm_oinfo->loi_mtime = loi->loi_mtime;
 
                 lov_set_add_req(req, set);
         }
index ffeec5c..ed1cfa2 100644 (file)
@@ -15,3 +15,4 @@ autoMakefile
 .tmp_versions
 .depend
 sources
+fsfilt_ldiskfs.c
index 5e6f9d3..ca1eb61 100644 (file)
@@ -351,8 +351,8 @@ int mdc_enqueue(struct obd_export *exp,
         if (it->d.lustre.it_status < 0 && req->rq_replay)
                 mdc_clear_replay_flag(req, it->d.lustre.it_status);
 
-        DEBUG_REQ(D_RPCTRACE, req, "disposition: %x, status: %d",
-                  it->d.lustre.it_disposition, it->d.lustre.it_status);
+        DEBUG_REQ(D_RPCTRACE, req, "op: %d disposition: %x, status: %d",
+                  it->it_op,it->d.lustre.it_disposition,it->d.lustre.it_status);
 
         /* We know what to expect, so we do any byte flipping required here */
         LASSERT(reply_buffers == 4 || reply_buffers == 3 || reply_buffers == 1);
index 02488ef..4fdfa6b 100644 (file)
@@ -759,7 +759,7 @@ static int mds_getattr_name(int offset, struct ptlrpc_request *req,
                 child_fid.id = res->lr_name.name[0];
                 child_fid.generation = res->lr_name.name[1];
                 dchild = mds_fid2dentry(&obd->u.mds, &child_fid, NULL);
-                LASSERT(dchild);
+                LASSERT(!IS_ERR(dchild));
                 LDLM_LOCK_PUT(granted_lock);
         }
 
index f6212a3..42d19c4 100644 (file)
@@ -309,8 +309,9 @@ static int mds_init_server_data(struct obd_device *obd, struct file *file)
                  * need to be set up like real exports as mds_connect() does.
                  */
                 CDEBUG(D_HA, "RCVRNG CLIENT uuid: %s idx: %d lr: "LPU64
-                       " srv lr: "LPU64"\n", mcd->mcd_uuid, cl_idx,
-                       last_transno, le64_to_cpu(msd->msd_last_transno));
+                       " srv lr: "LPU64" lx: "LPU64"\n", mcd->mcd_uuid, cl_idx,
+                       last_transno, le64_to_cpu(msd->msd_last_transno),
+                       le64_to_cpu(mcd->mcd_last_xid));
 
                 exp = class_new_export(obd);
                 if (exp == NULL)
index 9a2b7a7..a9eb5b0 100755 (executable)
@@ -1189,7 +1189,7 @@ class Network(Module):
         if '*' in self.nid:
             self.nid = sys_get_local_nid(self.net_type, self.nid, self.cluster_id)
             if not self.nid:
-                panic("unable to set nid for", self.net_type, self.nid, cluster_id)
+                panic("unable to set nid for", self.net_type, self.nid, self.cluster_id)
             self.generic_nid = 1
             debug("nid:", self.nid)
         else: