Whamcloud - gitweb
- apply andreas's patch to remove u16
authorpschwan <pschwan>
Tue, 12 Nov 2002 00:13:38 +0000 (00:13 +0000)
committerpschwan <pschwan>
Tue, 12 Nov 2002 00:13:38 +0000 (00:13 +0000)
- fix subtle rename() dentry bug

lustre/ChangeLog
lustre/include/linux/lustre_idl.h
lustre/llite/namei.c

index ac05e5c..3421e0e 100644 (file)
@@ -14,6 +14,7 @@ TBD
          - partial support for multiple MDS on a single host (623279, 241)
          - data locks weren't cancelled at clear_inode time (290, 311)
          - intent locks could lead to unbounded lock growth (205)
+         - added a maximum lock count, an LRU list, and a flusher
        * protocol change
           - Add capability to MDS protocol
          - LDLM cancellations and callbacks on different portals
index 2ef3481..0a412e7 100644 (file)
@@ -128,26 +128,26 @@ struct lustre_msg {
 /* Flags that apply to all requests are in the bottom 16 bits */
 #define MSG_GEN_FLAG_MASK  0x0000ffff
 
-static inline u16 lustre_msg_get_flags(struct lustre_msg *msg)
+static inline int lustre_msg_get_flags(struct lustre_msg *msg)
 {
-        return (u16)(msg->flags & MSG_GEN_FLAG_MASK);
+        return (msg->flags & MSG_GEN_FLAG_MASK);
 }
 
-static inline void lustre_msg_set_flags(struct lustre_msg *msg, u16 flags)
+static inline void lustre_msg_set_flags(struct lustre_msg *msg, int flags)
 {
         msg->flags &= ~MSG_GEN_FLAG_MASK;
-        msg->flags |= flags;
+        msg->flags |= MSG_GEN_FLAG_MASK & flags;
 }
 
-static inline u16 lustre_msg_get_op_flags(struct lustre_msg *msg)
+static inline int lustre_msg_get_op_flags(struct lustre_msg *msg)
 {
-        return (u16)(msg->flags >> MSG_OP_FLAG_SHIFT);
+        return (msg->flags >> MSG_OP_FLAG_SHIFT);
 }
 
-static inline void lustre_msg_set_op_flags(struct lustre_msg *msg, u16 flags)
+static inline void lustre_msg_set_op_flags(struct lustre_msg *msg, int flags)
 {
         msg->flags &= ~MSG_OP_FLAG_MASK;
-        msg->flags |= (flags << MSG_OP_FLAG_SHIFT);
+        msg->flags |= ((flags & MSG_GEN_FLAG_MASK) << MSG_OP_FLAG_SHIFT);
 }
 
 #define CONNMGR_REPLY  0
index 420ca29..8c6d9b6 100644 (file)
@@ -264,7 +264,6 @@ int ll_intent_lock(struct inode *parent, struct dentry **de,
                                 it->it_data = NULL;
                                 GOTO(drop_req, rc = it->it_status);
                         }
-                        it->it_data = dentry;
                         /* Fall through to update attibutes. */
                 } else if (it->it_op & (IT_UNLINK | IT_RMDIR)) {
                         /* For remove ops, we want the lookup to succeed unless
@@ -341,6 +340,9 @@ int ll_intent_lock(struct inode *parent, struct dentry **de,
                 ptlrpc_req_finished(request);
         }
 
+        if (it->it_disposition && it->it_op & (IT_RENAME | IT_LINK))
+                it->it_data = dentry;
+
         /* this places the intent in the dentry so that the vfs_xxx
          *  operation can lay its hands on it; but that is not 
          *  always needed...