]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/cifs/file.c
POSIX extensions disabled on client due to illegal O_EXCL flag sent to Samba
[karo-tx-linux.git] / fs / cifs / file.c
index c16d2a018ab85cfd30f2c49e0b948e528cafb9ff..8c0d8557731443ffb564905bb1ad0a9c64b8169b 100644 (file)
@@ -43,6 +43,7 @@
 #include "cifs_fs_sb.h"
 #include "fscache.h"
 
+
 static inline int cifs_convert_flags(unsigned int flags)
 {
        if ((flags & O_ACCMODE) == O_RDONLY)
@@ -72,10 +73,15 @@ static u32 cifs_posix_convert_flags(unsigned int flags)
        else if ((flags & O_ACCMODE) == O_RDWR)
                posix_flags = SMB_O_RDWR;
 
-       if (flags & O_CREAT)
+       if (flags & O_CREAT) {
                posix_flags |= SMB_O_CREAT;
-       if (flags & O_EXCL)
-               posix_flags |= SMB_O_EXCL;
+               if (flags & O_EXCL)
+                       posix_flags |= SMB_O_EXCL;
+       } else if (flags & O_EXCL)
+               cFYI(1, "Application %s pid %d has incorrectly set O_EXCL flag"
+                       "but not O_CREAT on file open. Ignoring O_EXCL",
+                       current->comm, current->tgid);
+
        if (flags & O_TRUNC)
                posix_flags |= SMB_O_TRUNC;
        /* be safe and imply O_SYNC for O_DSYNC */