From patchwork Wed Dec 11 22:29:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shirish Pargaonkar X-Patchwork-Id: 3328781 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4AB319F37C for ; Wed, 11 Dec 2013 22:30:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3BCC9207FD for ; Wed, 11 Dec 2013 22:30:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 17FAC207E0 for ; Wed, 11 Dec 2013 22:30:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751030Ab3LKWaF (ORCPT ); Wed, 11 Dec 2013 17:30:05 -0500 Received: from mail-oa0-f53.google.com ([209.85.219.53]:43267 "EHLO mail-oa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751000Ab3LKWaC (ORCPT ); Wed, 11 Dec 2013 17:30:02 -0500 Received: by mail-oa0-f53.google.com with SMTP id m1so8140783oag.12 for ; Wed, 11 Dec 2013 14:30:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=hTNn3g5HXqUMvOLYO4Cf5AHUcXABZ+B/8V1rGV296no=; b=tO5L/4TgbbRtAahZ5GLsO/kpdC7sjPetmYIBOfWER7mI+0Gyk+d/sJwLW1kniEGov4 HInWuSpDQr7VpRoYbSfN7YBzmfoerFKqzhTYwDNl3+mJGPSXiYeaafe34HoKu6PEj9Fm 8GB4RL2KVGH65xHvUEovzw0R6JsGZ2KXLsnoxIYpuEe09pfws4h8jEW/GecIbJlceewR SkAXsJ9B5z4isY5XV3EKG+8coq9bVCFUalbI+AqnlaTFSjvdI+Zjtfb7JTZrJ92f9AiV 0bMewadI3LHAsYZfCZHGR6PcDAaojTqW9I/NICBWOYflBlkDO9+EBn1AwwScqh2ts0O7 VQfA== X-Received: by 10.182.229.34 with SMTP id sn2mr161918obc.86.1386801001791; Wed, 11 Dec 2013 14:30:01 -0800 (PST) Received: from shirish-ThinkPad-T400.gateway.2wire.net (75-13-85-90.lightspeed.austtx.sbcglobal.net. [75.13.85.90]) by mx.google.com with ESMTPSA id ru3sm30988229obc.2.2013.12.11.14.30.00 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 11 Dec 2013 14:30:00 -0800 (PST) From: shirishpargaonkar@gmail.com To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, miklos@szeredi.hu, Shirish Pargaonkar , Shirish Pargaonkar Subject: [PATCH] cifs: set FILE_CREATED Date: Wed, 11 Dec 2013 16:29:53 -0600 Message-Id: <1386800993-4250-1-git-send-email-shirishpargaonkar@gmail.com> X-Mailer: git-send-email 1.8.3.2 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 From: Shirish Pargaonkar Set FILE_CREATED on O_CREAT|O_EXCL. cifs code didn't change during commit 116cc0225381415b96551f725455d067f63a76a0e Samba bugzilla 66251 Signed-off-by: Shirish Pargaonkar Acked-by: Jeff Layton --- fs/cifs/dir.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 11ff5f1..a514e0a 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -193,7 +193,7 @@ check_name(struct dentry *direntry) static int cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid, struct tcon_link *tlink, unsigned oflags, umode_t mode, - __u32 *oplock, struct cifs_fid *fid, int *created) + __u32 *oplock, struct cifs_fid *fid) { int rc = -ENOENT; int create_options = CREATE_NOT_DIR; @@ -349,7 +349,6 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid, .device = 0, }; - *created |= FILE_CREATED; if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) { args.uid = current_fsuid(); if (inode->i_mode & S_ISGID) @@ -480,13 +479,16 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry, cifs_add_pending_open(&fid, tlink, &open); rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode, - &oplock, &fid, opened); + &oplock, &fid); if (rc) { cifs_del_pending_open(&open); goto out; } + if ((oflags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL)) + *opened |= FILE_CREATED; + rc = finish_open(file, direntry, generic_file_open, opened); if (rc) { if (server->ops->close) @@ -529,7 +531,6 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode, struct TCP_Server_Info *server; struct cifs_fid fid; __u32 oplock; - int created = FILE_CREATED; cifs_dbg(FYI, "cifs_create parent inode = 0x%p name is: %s and dentry = 0x%p\n", inode, direntry->d_name.name, direntry); @@ -546,7 +547,7 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode, server->ops->new_lease_key(&fid); rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode, - &oplock, &fid, &created); + &oplock, &fid); if (!rc && server->ops->close) server->ops->close(xid, tcon, &fid);