diff --git a/lustre/ChangeLog b/lustre/ChangeLog
index 51566505df56e8f35624a0a58fff9360bc5a6220..f5d575448b05078a86d1f910a616549640fe16ff 100644
--- a/lustre/ChangeLog
+++ b/lustre/ChangeLog
@@ -485,6 +485,13 @@ Details    : ldlm pool logic depends on number of granted locks equal to
              number of released locks which is not true for flock locks, so
 	     just exclude such locks from consideration.
 
+Severity   : normal
+Bugzilla   : 15188
+Description: MDS deadlock with many ll_sync_lov threads and I/O stalled
+Details    : Use fsfilt_sync() for both the whole filesystem sync and
+             individual file sync to eliminate dangerous inode locking
+             with I_LOCK that can lead to a deadlock.
+
 --------------------------------------------------------------------------------
 
 2007-12-07         Cluster File Systems, Inc. <info@clusterfs.com>
diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c
index 7f4d30be8824b6cc18116ab4f3271b1bec860b7a..072591a1252cff7c1c8cb38dfcf32069018fe897 100644
--- a/lustre/mds/handler.c
+++ b/lustre/mds/handler.c
@@ -1169,30 +1169,22 @@ static int mds_sync(struct ptlrpc_request *req, int offset)
         if (rc)
                 GOTO(out, rc);
 
-        if (body->fid1.id == 0) {
-                /* a fid of zero is taken to mean "sync whole filesystem" */
-                rc = fsfilt_sync(obd, obd->u.obt.obt_sb);
-                GOTO(out, rc);
-        } else {
+        rc = fsfilt_sync(obd, obd->u.obt.obt_sb);
+        if (rc == 0 && body->fid1.id != 0) {
                 struct dentry *de;
 
                 de = mds_fid2dentry(mds, &body->fid1, NULL);
                 if (IS_ERR(de))
                         GOTO(out, rc = PTR_ERR(de));
 
-                /* The file parameter isn't used for anything */
-                if (de->d_inode->i_fop && de->d_inode->i_fop->fsync)
-                        rc = de->d_inode->i_fop->fsync(NULL, de, 1);
-                if (rc == 0) {
-                        body = lustre_msg_buf(req->rq_repmsg, REPLY_REC_OFF,
-                                              sizeof(*body));
-                        mds_pack_inode2fid(&body->fid1, de->d_inode);
-                        mds_pack_inode2body(body, de->d_inode);
-                }
+                body = lustre_msg_buf(req->rq_repmsg, REPLY_REC_OFF,
+                                      sizeof(*body));
+                mds_pack_inode2fid(&body->fid1, de->d_inode);
+                mds_pack_inode2body(body, de->d_inode);
 
                 l_dput(de);
-                GOTO(out, rc);
         }
+        GOTO(out, rc);
 out:
         req->rq_status = rc;
         return 0;