[linux-cifs-client] Another fix for kernel 2.4.x

Yehuda Sadeh Weinraub Yehuda.Sadeh at expand.com
Wed Sep 13 12:03:57 GMT 2006


And here's another fix:

There was a bug when creating a file with O_CREAT|O_EXCL, due to
different behavior in the vfs between 2.6 and 2.4 on such cases.

diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 423da1c..2f18a65 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -88,7 +88,11 @@ static inline int cifs_convert_flags(uns
 static inline int cifs_get_disposition(unsigned int flags)
 {
        if ((flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0)
                return FILE_CREATE;
+#else
+               return FILE_OPEN_IF;
+#endif
        else if ((flags & (O_CREAT | O_TRUNC)) == (O_CREAT | O_TRUNC))
                return FILE_OVERWRITE_IF;
        else if ((flags & O_CREAT) == O_CREAT)

Yehuda

> -----Original Message-----
> From: linux-cifs-client-bounces+yehudas=expand.com at lists.samba.org
> [mailto:linux-cifs-client-bounces+yehudas=expand.com at lists.samba.org]
On
> Behalf Of Yehuda Sadeh Weinraub
> Sent: Tuesday, September 12, 2006 2:04 PM
> To: linux-cifs-client at lists.samba.org
> Subject: [linux-cifs-client] Another fix for kernel 2.4.x
> 
> Hi,
> 
> Since we don't allocate the cifs_sb, we mustn't free it either.
> 
> Yehuda Sadeh-Weinraub
> 
> 
> diff --git a/fs/cifs/cifsfs24.c b/fs/cifs/cifsfs24.c
> index 31c053c..60c7973 100644
> --- a/fs/cifs/cifsfs24.c
> +++ b/fs/cifs/cifsfs24.c
> @@ -157,7 +157,6 @@ cifs_put_super(struct super_block *sb)
>                 cERROR(1, ("cifs_umount failed with return code %d",
> rc));
>         }
>         unload_nls(cifs_sb->local_nls);
> -       kfree(cifs_sb);
>         return;
>  }
> _______________________________________________
> linux-cifs-client mailing list
> linux-cifs-client at lists.samba.org
> https://lists.samba.org/mailman/listinfo/linux-cifs-client


More information about the linux-cifs-client mailing list