From patchwork Mon Jan 11 22:09:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roel kluin X-Patchwork-Id: 53744 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.samba.org (fn.samba.org [216.83.154.106]) by ozlabs.org (Postfix) with ESMTP id D6081B7D1C for ; Thu, 27 May 2010 22:36:35 +1000 (EST) Received: from fn.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id 1704C46646; Thu, 27 May 2010 06:35:21 -0600 (MDT) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on fn.samba.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.8 tests=BAYES_00,SPF_PASS autolearn=ham version=3.2.5 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from mail-ew0-f212.google.com (mail-ew0-f212.google.com [209.85.219.212]) by lists.samba.org (Postfix) with ESMTP id 7729346584; Mon, 11 Jan 2010 15:10:59 -0700 (MST) Received: by ewy4 with SMTP id 4so6981ewy.27 for ; Mon, 11 Jan 2010 14:05:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=kr3aewly+9PsAd/be7EztbV2YjHIFMKt5gp2Q5bD6HI=; b=fChT6kuVkMU74xNrkN/QI/YsOrMa6B77t2a5D+dwlhiYDMMIyuo7j7I9fWYoZ3vZQ7 OGmnv9tvyox7owogdDpysl7NYsJ8SLQCfil/mx347eLWNB9jQnsZCtqDfIcBhm9+HXSB qYWzciyfdviBIH7MYgtWZ6dEqtfxtCDynoGaQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=AfkwnumQ0HI/H3RdFqWIHVOlb6usBYgRYBEs+edlkdsDMDDKNcGThYBBE5QWFj2JCf UasLCP/dB7bCAOVOJaUdXnO8bV9ZIV7wdELHgvAevYovdM0uCMQpatcB93iQtEijz0oq 4hO2Gkv6e3OsCxuNdifffcSK1ujCTuSBpSqIc= Received: by 10.213.47.9 with SMTP id l9mr3774973ebf.93.1263247526268; Mon, 11 Jan 2010 14:05:26 -0800 (PST) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 7sm2166909eyb.18.2010.01.11.14.05.25 (version=SSLv3 cipher=RC4-MD5); Mon, 11 Jan 2010 14:05:25 -0800 (PST) Message-ID: <4B4BA1A4.9050800@gmail.com> Date: Mon, 11 Jan 2010 23:09:40 +0100 From: Roel Kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Thunderbird/3.0 MIME-Version: 1.0 To: Steve French References: <4B48D95D.5000106@gmail.com> <524f69651001111353u512e9b80s46b26714e27b5130@mail.gmail.com> In-Reply-To: <524f69651001111353u512e9b80s46b26714e27b5130@mail.gmail.com> X-Mailman-Approved-At: Thu, 27 May 2010 06:34:18 -0600 Cc: samba-technical@lists.samba.org, LKML , Steve French , Andrew Morton , linux-cifs-client@lists.samba.org Subject: Re: [linux-cifs-client] [PATCH] cifs: remove redundant test in cifs_lookup() and cifs_do_rename() X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-cifs-client-bounces@lists.samba.org Errors-To: linux-cifs-client-bounces@lists.samba.org rc != -EOPNOTSUPP is true as well if rc is -EINVAL. Signed-off-by: Roel Kluin --- > At first glance this looks like a typo (probably not a serious one, but > worth fixing) > > - else if ((rc == -EINVAL) || (rc != -EOPNOTSUPP)) > > looks like it should be: > > + else if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) > -- > Thanks, > > Steve Yes, according to the comment it appears you're right. Thanks diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 6ccf726..33a7427 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -690,7 +690,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, */ if ((rc == 0) || (rc == -ENOENT)) posix_open = true; - else if ((rc == -EINVAL) || (rc != -EOPNOTSUPP)) + else if ((rc == -EINVAL) || (rc == -EOPNOTSUPP)) pTcon->broken_posix_open = true; } if (!posix_open) diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index cf18ee7..aec2928 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -1264,7 +1264,7 @@ cifs_do_rename(int xid, struct dentry *from_dentry, const char *fromPath, * source Note that cross directory moves do not work with * rename by filehandle to various Windows servers. */ - if (rc == 0 || rc != -ETXTBSY) + if (rc != -ETXTBSY) return rc; /* open the file to be renamed -- we need DELETE perms */