The Samba-Bugzilla – Attachment 8542 Details for
Bug 9519
Samba returns unexpected error on SMB posix open
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
2nd try at kernel patch to warn on illegal app behavior (and ignoring O_EXCL)
warn-on-o_excl-try2.patch (text/plain), 993 bytes, created by
Steve French
on 2013-02-12 02:42:59 UTC
(
hide
)
Description:
2nd try at kernel patch to warn on illegal app behavior (and ignoring O_EXCL)
Filename:
MIME Type:
Creator:
Steve French
Created:
2013-02-12 02:42:59 UTC
Size:
993 bytes
patch
obsolete
>diff --git a/fs/cifs/file.c b/fs/cifs/file.c >index 8ea6ca5..39354c2 100644 >--- a/fs/cifs/file.c >+++ b/fs/cifs/file.c >@@ -43,6 +43,9 @@ > #include "cifs_fs_sb.h" > #include "fscache.h" > >+static bool warned_on_bad_open_flags; /* globals init to false automatically */ >+ >+ > static inline int cifs_convert_flags(unsigned int flags) > { > if ((flags & O_ACCMODE) == O_RDONLY) >@@ -72,10 +75,17 @@ 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) { >+ warned_on_bad_open_flags = true; >+ cERROR(1, "Application has incorrectly set O_EXCL flag but " >+ "not O_CREAT on file open. Ignoring O_EXCL"); >+ } >+ >+ > if (flags & O_TRUNC) > posix_flags |= SMB_O_TRUNC; > /* be safe and imply O_SYNC for O_DSYNC */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 9519
:
8365
|
8366
|
8541
| 8542 |
8544