From patchwork Sat Jul 23 00:02:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sage Weil X-Patchwork-Id: 1001352 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6N08HNl032329 for ; Sat, 23 Jul 2011 00:16:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754012Ab1GWAF6 (ORCPT ); Fri, 22 Jul 2011 20:05:58 -0400 Received: from cobra.newdream.net ([66.33.216.30]:44311 "EHLO cobra.newdream.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753981Ab1GWAFy (ORCPT ); Fri, 22 Jul 2011 20:05:54 -0400 Received: from localhost.localdomain (ip-64-111-111-107.dreamhost.com [64.111.111.107]) by cobra.newdream.net (Postfix) with ESMTPA id 8AFFDBC96A; Fri, 22 Jul 2011 17:09:37 -0700 (PDT) From: Sage Weil To: ceph-devel@vger.kernel.org Cc: Sage Weil Subject: [PATCH 10/23] ceph: only link open operations to directory unsafe list if O_CREAT|O_TRUNC Date: Fri, 22 Jul 2011 17:02:49 -0700 Message-Id: <1311379382-9218-11-git-send-email-sage@newdream.net> X-Mailer: git-send-email 1.7.0 In-Reply-To: <1311379382-9218-1-git-send-email-sage@newdream.net> References: <1311379382-9218-1-git-send-email-sage@newdream.net> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 23 Jul 2011 00:16:08 +0000 (UTC) We only need to put these on the directory unsafe list if they have side effects that fsync(2) should flush out. Signed-off-by: Sage Weil --- fs/ceph/file.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 9b667e9..e0115eb 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -194,7 +194,8 @@ int ceph_open(struct inode *inode, struct file *file) req->r_inode = inode; ihold(inode); req->r_num_caps = 1; - err = ceph_mdsc_do_request(mdsc, parent_inode, req); + err = ceph_mdsc_do_request(mdsc, (flags & (O_CREAT|O_TRUNC)) ? + parent_inode : NULL, req); if (!err) err = ceph_init_file(inode, file, req->r_fmode); ceph_mdsc_put_request(req);