Commit dc10bf37 authored by Pavel Shilovsky's avatar Pavel Shilovsky

Fix missing share flags during creating for 2.6.31

parent 9f638c2e
......@@ -1124,6 +1124,7 @@ psx_create_err:
return rc;
}
#ifdef ETERSOFT_USE_SMB_LEGACY_OPEN
static __u16 convert_disposition(int disposition)
{
__u16 ofun = 0;
......@@ -1167,6 +1168,7 @@ access_flags_to_smbopen_mode(const int access_flags)
/* just go for read/write */
return SMBOPEN_READWRITE;
}
#endif
int
SMBLegacyOpen(const int xid, struct cifsTconInfo *tcon,
......@@ -1175,6 +1177,10 @@ SMBLegacyOpen(const int xid, struct cifsTconInfo *tcon,
int *pOplock, FILE_ALL_INFO *pfile_info,
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;
OPENX_REQ *pSMB = NULL;
OPENX_RSP *pSMBr = NULL;
......@@ -1182,10 +1188,6 @@ SMBLegacyOpen(const int xid, struct cifsTconInfo *tcon,
int name_len;
__u16 count;
#ifndef ETERSOFT_USE_SMB_LEGACY_OPEN
printk("Etersoft: Do not use SMBLegacyOpen!\n");
return rc;
#else
OldOpenRetry:
rc = smb_init(SMB_COM_OPEN_ANDX, 15, tcon, (void **) &pSMB,
(void **) &pSMBr);
......
......@@ -321,6 +321,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
oflags = FMODE_READ;
if (tcon->unix_ext && (tcon->ses->capabilities & CAP_UNIX) &&
((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOPOSIXBRL) == 0) &&
(CIFS_UNIX_POSIX_PATH_OPS_CAP &
le64_to_cpu(tcon->fsUnixInfo.Capability))) {
rc = cifs_posix_open(full_path, &newinode, inode->i_sb,
......@@ -386,7 +387,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
if (cifs_sb->tcon->ses->capabilities & CAP_NT_SMBS)
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,
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
else
......@@ -681,7 +682,8 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
* reduction in network traffic in the other paths.
*/
if (pTcon->unix_ext) {
if (!(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->intent.open.flags & O_CREAT)) {
rc = cifs_posix_open(full_path, &newInode,
......
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