diff --git a/lustre/ChangeLog b/lustre/ChangeLog
index 8afb64c97666c1dc09234db2430b62711783c057..34944b4caeffeb76a540263138b359eec0a3b1a2 100644
--- a/lustre/ChangeLog
+++ b/lustre/ChangeLog
@@ -1478,6 +1478,13 @@ Details    : Add two new failloc constants to test lockless IO. Only one of
 	     them in implemented---another is checked in yet to be landed
 	     core CLIO code.
 
+Severity   : normal
+Bugzilla   : 16450
+Description: Add lockdep support for inode mutex.
+Details    : Introduce and use new LOCK_INODE_MUTEX_PARENT() macro to be used
+	     in the situations where Lustre has to lock more than one inode
+	     mutex at a time.
+
 --------------------------------------------------------------------------------
 
 2007-08-10         Cluster File Systems, Inc. <info@clusterfs.com>
diff --git a/lustre/include/linux/lustre_compat25.h b/lustre/include/linux/lustre_compat25.h
index 9a57ebdb484c729ebfc24a08d8cc47466996b65a..1e59fe7de4ca37096f0b61046d35161163d56370 100644
--- a/lustre/include/linux/lustre_compat25.h
+++ b/lustre/include/linux/lustre_compat25.h
@@ -88,11 +88,14 @@ static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt,
 #if HAVE_INODE_I_MUTEX
 #define UNLOCK_INODE_MUTEX(inode) do {mutex_unlock(&(inode)->i_mutex); } while(0)
 #define LOCK_INODE_MUTEX(inode) do {mutex_lock(&(inode)->i_mutex); } while(0)
+#define LOCK_INODE_MUTEX_PARENT(inode) \
+do {mutex_lock_nested(&(inode)->i_mutex, I_MUTEX_PARENT); } while(0)
 #define TRYLOCK_INODE_MUTEX(inode) mutex_trylock(&(inode)->i_mutex)
 #else
 #define UNLOCK_INODE_MUTEX(inode) do {up(&(inode)->i_sem); } while(0)
 #define LOCK_INODE_MUTEX(inode) do {down(&(inode)->i_sem); } while(0)
 #define TRYLOCK_INODE_MUTEX(inode) (!down_trylock(&(inode)->i_sem))
+#define LOCK_INODE_MUTEX_PARENT(inode) LOCK_INODE_MUTEX(inode)
 #endif /* HAVE_INODE_I_MUTEX */
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
diff --git a/lustre/lvfs/quotafmt_test.c b/lustre/lvfs/quotafmt_test.c
index b5e0a4b5ede96b41fe4b0a59a23add951a375803..2b3738787ee30defb6f254e0050fe9c8117e14ba 100644
--- a/lustre/lvfs/quotafmt_test.c
+++ b/lustre/lvfs/quotafmt_test.c
@@ -81,7 +81,7 @@ static int quotfmt_initialize(struct lustre_quota_info *lqi,
                 int namelen = strlen(name);
 
                 /* remove the stale test quotafile */
-                LOCK_INODE_MUTEX(parent_inode);
+                LOCK_INODE_MUTEX_PARENT(parent_inode);
                 de = lookup_one_len(name, tgt->obd_lvfs_ctxt.pwd, namelen);
                 if (!IS_ERR(de) && de->d_inode)
                         ll_vfs_unlink(parent_inode, de, 
@@ -136,7 +136,7 @@ static int quotfmt_finalize(struct lustre_quota_info *lqi,
                 filp_close(lqi->qi_files[i], 0);
 
                 /* unlink quota file */
-                LOCK_INODE_MUTEX(parent_inode);
+                LOCK_INODE_MUTEX_PARENT(parent_inode);
 
                 de = lookup_one_len(name, tgt->obd_lvfs_ctxt.pwd, namelen);
                 if (IS_ERR(de) || de->d_inode == NULL) {
diff --git a/lustre/mds/mds_fs.c b/lustre/mds/mds_fs.c
index 97feafb450b1951430b5faf3155780a389297dd3..ec83e305f1d7609d8d604bf110d7ebc59e6e7115 100644
--- a/lustre/mds/mds_fs.c
+++ b/lustre/mds/mds_fs.c
@@ -106,7 +106,7 @@ int mds_obd_create(struct obd_export *exp, struct obdo *oa,
         oa->o_generation = filp->f_dentry->d_inode->i_generation;
         namelen = ll_fid2str(fidname, oa->o_id, oa->o_generation);
 
-        LOCK_INODE_MUTEX(parent_inode);
+        LOCK_INODE_MUTEX_PARENT(parent_inode);
         new_child = lookup_one_len(fidname, mds->mds_objects_dir, namelen);
 
         if (IS_ERR(new_child)) {
@@ -176,7 +176,7 @@ int mds_obd_destroy(struct obd_export *exp, struct obdo *oa,
 
         namelen = ll_fid2str(fidname, oa->o_id, oa->o_generation);
 
-        LOCK_INODE_MUTEX(parent_inode);
+        LOCK_INODE_MUTEX_PARENT(parent_inode);
         de = lookup_one_len(fidname, mds->mds_objects_dir, namelen);
         if (IS_ERR(de)) {
                 rc = IS_ERR(de);
diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c
index 4c8d301993080065c6d23884e361593b5f3858fa..d66bb932640281e8473101e21ea8dfed69958b06 100644
--- a/lustre/obdfilter/filter.c
+++ b/lustre/obdfilter/filter.c
@@ -1406,7 +1406,7 @@ obd_id filter_last_id(struct filter_obd *filter, obd_gr group)
 
 static int filter_lock_dentry(struct obd_device *obd, struct dentry *dparent)
 {
-        LOCK_INODE_MUTEX(dparent->d_inode);
+        LOCK_INODE_MUTEX_PARENT(dparent->d_inode);
         return 0;
 }