Commit d7521042 authored by Pavel Shilovsky's avatar Pavel Shilovsky

Fix missing share flags during creating for 2.6.32

parent dc10bf37
...@@ -1059,6 +1059,7 @@ psx_create_err: ...@@ -1059,6 +1059,7 @@ psx_create_err:
return rc; return rc;
} }
#ifdef ETERSOFT_USE_SMB_LEGACY_OPEN
static __u16 convert_disposition(int disposition) static __u16 convert_disposition(int disposition)
{ {
__u16 ofun = 0; __u16 ofun = 0;
...@@ -1102,6 +1103,7 @@ access_flags_to_smbopen_mode(const int access_flags) ...@@ -1102,6 +1103,7 @@ access_flags_to_smbopen_mode(const int access_flags)
/* just go for read/write */ /* just go for read/write */
return SMBOPEN_READWRITE; return SMBOPEN_READWRITE;
} }
#endif
int int
SMBLegacyOpen(const int xid, struct cifsTconInfo *tcon, SMBLegacyOpen(const int xid, struct cifsTconInfo *tcon,
...@@ -1110,6 +1112,10 @@ SMBLegacyOpen(const int xid, struct cifsTconInfo *tcon, ...@@ -1110,6 +1112,10 @@ SMBLegacyOpen(const int xid, struct cifsTconInfo *tcon,
int *pOplock, FILE_ALL_INFO *pfile_info, int *pOplock, FILE_ALL_INFO *pfile_info,
const struct nls_table *nls_codepage, int remap) const struct nls_table *nls_codepage, int remap)
{ {
#ifndef ETERSOFT_USE_SMB_LEGACY_OPEN
printk("Etersoft: Do not use SMBLegacyOpen!\n");
return -EACCES;
#else
int rc = -EACCES; int rc = -EACCES;
OPENX_REQ *pSMB = NULL; OPENX_REQ *pSMB = NULL;
OPENX_RSP *pSMBr = NULL; OPENX_RSP *pSMBr = NULL;
...@@ -1117,10 +1123,6 @@ SMBLegacyOpen(const int xid, struct cifsTconInfo *tcon, ...@@ -1117,10 +1123,6 @@ SMBLegacyOpen(const int xid, struct cifsTconInfo *tcon,
int name_len; int name_len;
__u16 count; __u16 count;
#ifndef ETERSOFT_USE_SMB_LEGACY_OPEN
printk("Etersoft: Do not use SMBLegacyOpen!\n");
return rc;
#else
OldOpenRetry: OldOpenRetry:
rc = smb_init(SMB_COM_OPEN_ANDX, 15, tcon, (void **) &pSMB, rc = smb_init(SMB_COM_OPEN_ANDX, 15, tcon, (void **) &pSMB,
(void **) &pSMBr); (void **) &pSMBr);
......
...@@ -317,6 +317,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, ...@@ -317,6 +317,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
oflags = FMODE_READ; oflags = FMODE_READ;
if (tcon->unix_ext && (tcon->ses->capabilities & CAP_UNIX) && if (tcon->unix_ext && (tcon->ses->capabilities & CAP_UNIX) &&
((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOPOSIXBRL) == 0) &&
(CIFS_UNIX_POSIX_PATH_OPS_CAP & (CIFS_UNIX_POSIX_PATH_OPS_CAP &
le64_to_cpu(tcon->fsUnixInfo.Capability))) { le64_to_cpu(tcon->fsUnixInfo.Capability))) {
rc = cifs_posix_open(full_path, &newinode, nd->path.mnt, rc = cifs_posix_open(full_path, &newinode, nd->path.mnt,
...@@ -379,7 +380,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, ...@@ -379,7 +380,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
if (cifs_sb->tcon->ses->capabilities & CAP_NT_SMBS) if (cifs_sb->tcon->ses->capabilities & CAP_NT_SMBS)
rc = CIFSSMBOpen(xid, tcon, full_path, disposition, rc = CIFSSMBOpen(xid, tcon, full_path, disposition,
desiredAccess, FILE_SHARE_ALL, create_options, desiredAccess, ~((oflags>>21) & 7), create_options,
&fileHandle, &oplock, buf, cifs_sb->local_nls, &fileHandle, &oplock, buf, cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
else else
...@@ -675,6 +676,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, ...@@ -675,6 +676,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
*/ */
if (pTcon->unix_ext) { if (pTcon->unix_ext) {
if (nd && !(nd->flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY)) && if (nd && !(nd->flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY)) &&
((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOPOSIXBRL) == 0) &&
(nd->flags & LOOKUP_OPEN) && !pTcon->broken_posix_open && (nd->flags & LOOKUP_OPEN) && !pTcon->broken_posix_open &&
(nd->intent.open.flags & O_CREAT)) { (nd->intent.open.flags & O_CREAT)) {
rc = cifs_posix_open(full_path, &newInode, nd->path.mnt, rc = cifs_posix_open(full_path, &newInode, nd->path.mnt,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment