lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <4B4BA1A4.9050800@gmail.com>
Date:	Mon, 11 Jan 2010 23:09:40 +0100
From:	Roel Kluin <roel.kluin@...il.com>
To:	Steve French <smfrench@...il.com>
CC:	Steve French <sfrench@...ba.org>,
	linux-cifs-client@...ts.samba.org, samba-technical@...ts.samba.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Shirish Pargaonkar <shirishpargaonkar@...il.com>
Subject: Re: [PATCH] cifs: remove redundant test in cifs_lookup() and 	cifs_do_rename()

rc != -EOPNOTSUPP is true as well if rc is -EINVAL.

Signed-off-by: Roel Kluin <roel.kluin@...il.com>
---
> 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 */

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ