[linux-cifs-client] [PATCH] cifs: remove redundant test in cifs_lookup() and cifs_do_rename()

Steve French smfrench at gmail.com
Mon Jan 11 14:53:08 MST 2010


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))

On Sat, Jan 9, 2010 at 1:30 PM, Roel Kluin <roel.kluin at gmail.com> wrote:

> rc != -EOPNOTSUPP is true as well if rc is -EINVAL.
>
> Signed-off-by: Roel Kluin <roel.kluin at gmail.com>
> ---
>  fs/cifs/dir.c   |    2 +-
>  fs/cifs/inode.c |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> Or maybe there is ==/!= or &&/|| confusion?
>
> diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
> index 6ccf726..f5cfdd6 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 != -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 */
>



-- 
Thanks,

Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/linux-cifs-client/attachments/20100111/897751c3/attachment-0001.html>


More information about the linux-cifs-client mailing list