From patchwork Thu Aug 13 09:01:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ma, Jianpeng" X-Patchwork-Id: 7006871 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 90B4FC05AC for ; Thu, 13 Aug 2015 09:01:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C5C51206FC for ; Thu, 13 Aug 2015 09:01:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0FBE12060C for ; Thu, 13 Aug 2015 09:01:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752486AbbHMJBl (ORCPT ); Thu, 13 Aug 2015 05:01:41 -0400 Received: from mga03.intel.com ([134.134.136.65]:47782 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752425AbbHMJBi convert rfc822-to-8bit (ORCPT ); Thu, 13 Aug 2015 05:01:38 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP; 13 Aug 2015 02:01:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,668,1432623600"; d="scan'208";a="767938182" Received: from kmsmsx154.gar.corp.intel.com ([172.21.73.14]) by fmsmga001.fm.intel.com with ESMTP; 13 Aug 2015 02:01:36 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by KMSMSX154.gar.corp.intel.com (172.21.73.14) with Microsoft SMTP Server (TLS) id 14.3.224.2; Thu, 13 Aug 2015 17:01:33 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.171]) by shsmsx102.ccr.corp.intel.com ([169.254.2.206]) with mapi id 14.03.0224.002; Thu, 13 Aug 2015 17:01:32 +0800 From: "Ma, Jianpeng" To: Sage Weil CC: "ceph-devel@vger.kernel.org" , "zyan@redhat.com" Subject: [PATCH] ceph: Using file->f_flags rather than flags check O_CREAT. Thread-Topic: [PATCH] ceph: Using file->f_flags rather than flags check O_CREAT. Thread-Index: AdDVpl++S8a2XAkySPCvouudN7DhQA== Date: Thu, 13 Aug 2015 09:01:32 +0000 Message-ID: <6AA21C22F0A5DA478922644AD2EC308C1D19E799@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Because flags removed the O_CREAT, so we should use file->f_flags. Signed-off-by: Jianpeng Ma --- fs/ceph/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 8b79d87..e1347cf 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -210,7 +210,7 @@ int ceph_open(struct inode *inode, struct file *file) ihold(inode); req->r_num_caps = 1; - if (flags & O_CREAT) + if (file->f_flags & O_CREAT) parent_inode = ceph_get_dentry_parent_inode(file->f_path.dentry); err = ceph_mdsc_do_request(mdsc, parent_inode, req); iput(parent_inode);