From dd35ef95183c23ffd7aefcd7f129898d2e1a5573 Mon Sep 17 00:00:00 2001 From: pschwan Date: Tue, 12 Nov 2002 00:13:38 +0000 Subject: [PATCH] - apply andreas's patch to remove u16 - fix subtle rename() dentry bug --- lustre/ChangeLog | 1 + lustre/include/linux/lustre_idl.h | 16 ++++++++-------- lustre/llite/namei.c | 4 +++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index ac05e5c..3421e0e 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -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 diff --git a/lustre/include/linux/lustre_idl.h b/lustre/include/linux/lustre_idl.h index 2ef3481..0a412e7f 100644 --- a/lustre/include/linux/lustre_idl.h +++ b/lustre/include/linux/lustre_idl.h @@ -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 diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index 420ca29..8c6d9b6 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -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... -- 1.8.3.1