Commit 6b4d62ac authored by Konstantin Baev's avatar Konstantin Baev

Sources changed - now it's with Etersoft patches

Sources will be packaged in separate kernel-source package, named kernel-source-etercifs-legacy-1.50c
parent 9054cc31
tar.bz2: new-cifs-backport name=cifs-@version@ base=new-cifs-backport
tar.bz2: cifs name=kernel-source-etercifs-legacy-1.50c
tar.bz2: linux-cifs
kernel-source-etercifs-2.6.23.spec
linux-cifs.spec~
#
# Makefile for Linux CIFS VFS client
#
obj-$(CONFIG_CIFS) += etercifs.o
etercifs-objs := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o fcntl.o readdir.o ioctl.o sess.o export.o
......@@ -26,7 +26,7 @@
#include "cifsglob.h"
#include "cifs_debug.h"
#include "cifsproto.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
#include <linux/config.h>
#endif
......
......@@ -463,6 +463,8 @@ static read_proc_t experimEnabled_read;
static write_proc_t experimEnabled_write;
static read_proc_t linuxExtensionsEnabled_read;
static write_proc_t linuxExtensionsEnabled_write;
static read_proc_t etersoft_read;
static write_proc_t etersoft_write;
void
cifs_proc_init(void)
......@@ -527,6 +529,12 @@ cifs_proc_init(void)
if (pde)
pde->write_proc = lookupFlag_write;
pde =
create_proc_read_entry("Etersoft", 0, proc_fs_cifs,
etersoft_read, NULL);
if (pde)
pde->write_proc = etersoft_write;
/* pde =
create_proc_read_entry("NTLMV2Enabled", 0, proc_fs_cifs,
ntlmv2_enabled_read, NULL);
......@@ -560,6 +568,7 @@ cifs_proc_clean(void)
remove_proc_entry("LinuxExtensionsEnabled", proc_fs_cifs);
remove_proc_entry("Experimental", proc_fs_cifs);
remove_proc_entry("LookupCacheEnabled", proc_fs_cifs);
remove_proc_entry("Etersoft",proc_fs_cifs);
remove_proc_entry("cifs", proc_root_fs);
}
......@@ -913,4 +922,44 @@ security_flags_write(struct file *file, const char __user *buffer,
/* BB should we turn on MAY flags for other MUST options? */
return count;
}
static int
etersoft_read(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
int len;
len = sprintf(page, "%d\n", etersoft_flag);
len -= off;
*start = page + off;
if (len > count)
len = count;
else
*eof = 1;
if (len < 0)
len = 0;
return len;
}
static int
etersoft_write(struct file *file, const char __user *buffer,
unsigned long count, void *data)
{
char c;
int rc;
rc = get_user(c, buffer);
if (rc)
return rc;
if (c == '0' || c == 'n' || c == 'N')
etersoft_flag = 0;
else if (c == '1' || c == 'y' || c == 'Y')
etersoft_flag = 1;
return count;
}
#endif
......@@ -61,6 +61,7 @@ extern struct export_operations cifs_export_ops;
int cifsFYI = 0;
int cifsERROR = 1;
int traceSMB = 0;
unsigned int etersoft_flag = 1;
unsigned int oplockEnabled = 1;
unsigned int experimEnabled = 0;
unsigned int linuxExtEnabled = 1;
......@@ -190,7 +191,7 @@ cifs_put_super(struct super_block *sb)
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 15)
void * kzalloc(size_t size, unsigned flgs)
void * kzalloc(size_t size, int flgs)
{
void * buf;
buf = kmalloc(size, flgs);
......@@ -511,7 +512,8 @@ static void cifs_umount_begin(struct super_block * sblock)
}
#ifdef CONFIG_CIFS_STATS2
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17)
/* Hack for too updated SUSE kernel 2.6.16.46 */
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17)) || defined (CONFIG_SLE_SP)
static int cifs_show_stats(struct seq_file *s, struct vfsmount *mnt)
{
/* BB FIXME */
......@@ -627,6 +629,19 @@ static ssize_t cifs_file_aio_write(struct kiocb *iocb, const char __user *buf,
return written;
}
static ssize_t cifs_file_read(struct file *file, char *user, size_t cnt, loff_t *pos)
{
if( file!=NULL && file->f_dentry!=NULL && CIFS_I(file->f_dentry->d_inode)!=NULL ) {
int retval = 0;
CIFS_I(file->f_dentry->d_inode)->needForceInvalidate = 1;
retval = cifs_revalidate(file->f_dentry);
if( retval < 0 )
return (ssize_t)retval;
}
return do_sync_read(file,user,cnt,pos);
}
static loff_t cifs_llseek(struct file *file, loff_t offset, int origin)
{
/* origin == SEEK_END => we must revalidate the cached file length */
......@@ -715,7 +730,7 @@ const struct inode_operations cifs_symlink_inode_ops = {
};
const struct file_operations cifs_file_ops = {
.read = do_sync_read,
.read = cifs_file_read,
.write = do_sync_write,
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)
.readv = generic_file_readv,
......@@ -1058,6 +1073,10 @@ static int cifs_oplock_thread(void *dummyarg)
to server still is disconnected since oplock
already released by the server in that case */
if (pTcon->tidStatus != CifsNeedReconnect) {
/* PV: disable caching if oplock missed */
CIFS_I(inode)->clientCanCacheRead = FALSE;
CIFS_I(inode)->clientCanCacheAll = FALSE;
rc = CIFSSMBLock(0, pTcon, netfid,
0 /* len */ , 0 /* offset */, 0,
0, LOCKING_ANDX_OPLOCK_RELEASE,
......
......@@ -363,6 +363,7 @@ struct cifsInodeInfo {
unsigned clientCanCacheRead:1; /* read oplock */
unsigned clientCanCacheAll:1; /* read and writebehind oplock */
unsigned oplockPending:1;
unsigned needForceInvalidate:1;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0)
struct inode vfs_inode;
#endif
......@@ -611,6 +612,8 @@ GLOBAL_EXTERN atomic_t smBufAllocCount;
GLOBAL_EXTERN atomic_t midCount;
/* Misc globals */
GLOBAL_EXTERN unsigned int etersoft_flag; /* if enabled allows extended shared modes in open */
GLOBAL_EXTERN unsigned int multiuser_mount; /* if enabled allows new sessions
to be established on existing mount if we
have the uid/password or Kerberos credential
......
......@@ -269,7 +269,7 @@ extern int CIFSSMBQueryReparseLinkInfo(const int xid,
extern int CIFSSMBOpen(const int xid, struct cifsTconInfo *tcon,
const char *fileName, const int disposition,
const int access_flags, const int omode,
const int access_flags, const int share_flags, const int omode,
__u16 * netfid, int *pOplock, FILE_ALL_INFO *,
const struct nls_table *nls_codepage, int remap);
extern int SMBLegacyOpen(const int xid, struct cifsTconInfo *tcon,
......@@ -377,6 +377,6 @@ extern int CIFSSMBSetPosixACL(const int xid, struct cifsTconInfo *tcon,
extern int CIFSGetExtAttr(const int xid, struct cifsTconInfo *tcon,
const int netfid, __u64 * pExtAttrBits, __u64 *pMask);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
extern void * kzalloc(size_t size, unsigned flgs);
extern void * kzalloc(size_t size, int flgs);
#endif
#endif /* _CIFSPROTO_H */
......@@ -1187,6 +1187,11 @@ SMBLegacyOpen(const int xid, struct cifsTconInfo *tcon,
int name_len;
__u16 count;
if (etersoft_flag) {
printk("Etersoft: Do not use SMBLegacyOpen!\n");
return rc;
}
OldOpenRetry:
rc = smb_init(SMB_COM_OPEN_ANDX, 15, tcon, (void **) &pSMB,
(void **) &pSMBr);
......@@ -1291,7 +1296,7 @@ OldOpenRetry:
int
CIFSSMBOpen(const int xid, struct cifsTconInfo *tcon,
const char *fileName, const int openDisposition,
const int access_flags, const int create_options, __u16 * netfid,
const int access_flags, const int share_flags, const int create_options, __u16 * netfid,
int *pOplock, FILE_ALL_INFO * pfile_info,
const struct nls_table *nls_codepage, int remap)
{
......@@ -1349,7 +1354,7 @@ openRetry:
/* Above line causes problems due to vfs splitting create into two
pieces - need to set mode after file created not while it is
being created */
pSMB->ShareAccess = cpu_to_le32(FILE_SHARE_ALL);
pSMB->ShareAccess = cpu_to_le32(share_flags);
pSMB->CreateDisposition = cpu_to_le32(openDisposition);
pSMB->CreateOptions = cpu_to_le32(create_options & CREATE_OPTIONS_MASK);
/* BB Expirement with various impersonation levels and verify */
......
......@@ -40,6 +40,7 @@
#include <linux/kthread.h>
#include <asm/uaccess.h>
#include <asm/processor.h>
#include <linux/autoconf.h>
#include "cifspdu.h"
#include "cifsglob.h"
#include "cifsproto.h"
......@@ -829,7 +830,7 @@ cifs_parse_mount_options(char *options, const char *devname,
if (Local_System_Name[0] != 0)
memcpy(vol->source_rfc1001_name, Local_System_Name, 15);
else {
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18)
##if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18) || defined CONFIG_VE
char *nodename = utsname()->nodename;
#else
char *nodename = system_utsname.nodename;
......@@ -1830,16 +1831,17 @@ void reset_cifs_unix_caps(int xid, struct cifsTconInfo *tcon,
cFYI(1, ("very large write cap"));
#endif /* CIFS_DEBUG2 */
if (CIFSSMBSetFSUnixInfo(xid, tcon, cap)) {
if (vol_info == NULL)
if (vol_info == NULL) {
cFYI(1, ("resetting capabilities failed"));
else
}
else {
cERROR(1, ("Negotiating Unix capabilities "
"with the server failed. Consider "
"mounting with the Unix Extensions\n"
"disabled, if problems are found, "
"by specifying the nounix mount "
"option."));
}
}
}
}
......@@ -2413,7 +2415,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses,
32, nls_codepage);
bcc_ptr += 2 * bytes_returned;
bytes_returned =
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18)
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18) || defined CONFIG_VE
cifs_strtoUCS((__le16 *) bcc_ptr, utsname()->release,
32, nls_codepage);
#else
......@@ -2445,7 +2447,7 @@ CIFSSessSetup(unsigned int xid, struct cifsSesInfo *ses,
}
strcpy(bcc_ptr, "Linux version ");
bcc_ptr += strlen("Linux version ");
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18)
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18) || defined CONFIG_VE
strcpy(bcc_ptr, utsname()->release);
bcc_ptr += strlen(utsname()->release) + 1;
#else
......@@ -2734,7 +2736,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
32, nls_codepage);
bcc_ptr += 2 * bytes_returned;
bytes_returned =
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18)
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18) || defined CONFIG_VE
cifs_strtoUCS((__le16 *) bcc_ptr, utsname()->release, 32,
nls_codepage);
#else
......@@ -2756,7 +2758,7 @@ CIFSNTLMSSPNegotiateSessSetup(unsigned int xid,
} else { /* ASCII */
strcpy(bcc_ptr, "Linux version ");
bcc_ptr += strlen("Linux version ");
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18)
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18) || defined CONFIG_VE
strcpy(bcc_ptr, utsname()->release);
bcc_ptr += strlen(utsname()->release) + 1;
#else
......@@ -3139,7 +3141,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
32, nls_codepage);
bcc_ptr += 2 * bytes_returned;
bytes_returned =
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18)
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18) || defined CONFIG_VE
cifs_strtoUCS((__le16 *) bcc_ptr, utsname()->release, 32,
nls_codepage);
#else
......@@ -3195,7 +3197,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
strcpy(bcc_ptr, "Linux version ");
bcc_ptr += strlen("Linux version ");
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18)
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18) || defined CONFIG_VE
strcpy(bcc_ptr, utsname()->release);
bcc_ptr += strlen(utsname()->release) + 1;
#else
......
......@@ -209,7 +209,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode)
}
if (cifs_sb->tcon->ses->capabilities & CAP_NT_SMBS)
rc = CIFSSMBOpen(xid, pTcon, full_path, disposition,
desiredAccess, CREATE_NOT_DIR,
desiredAccess, FILE_SHARE_ALL, CREATE_NOT_DIR,
&fileHandle, &oplock, buf, cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
else
......@@ -419,6 +419,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, int devic
WRITE_OWNER | WRITE_DAC be better? */,
/* Create a file and set the
file attribute to SYSTEM */
FILE_SHARE_ALL,
CREATE_NOT_DIR | CREATE_OPTION_SPECIAL,
&fileHandle, &oplock, buf,
cifs_sb->local_nls,
......
......@@ -98,7 +98,7 @@ int cifs_dir_notify(struct file *file, unsigned long arg)
} else {
cFYI(1, ("dir notify on file %s Arg 0x%lx", full_path, arg));
rc = CIFSSMBOpen(xid, pTcon, full_path, FILE_OPEN,
GENERIC_READ | SYNCHRONIZE, 0 /* create options */,
GENERIC_READ | SYNCHRONIZE, FILE_SHARE_ALL, 0 /* create options */,
&netfid, &oplock, NULL, cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
/* BB fixme - add this handle to a notify handle list */
......
......@@ -109,6 +109,13 @@ static inline int cifs_get_disposition(unsigned int flags)
return FILE_OPEN;
}
static inline int cifs_get_share_flags(unsigned int flags)
{
if (!etersoft_flag)
return FILE_SHARE_ALL;
return ((~(flags>>29))&7);
}
/* all arguments to this function must be checked for validity in caller */
static inline int cifs_open_inode_helper(struct inode *inode, struct file *file,
struct cifsInodeInfo *pCifsInode, struct cifsFileInfo *pCifsFile,
......@@ -221,6 +228,7 @@ int cifs_open(struct inode *inode, struct file *file)
struct list_head *tmp;
char *full_path = NULL;
int desiredAccess;
int desiredShare;
int disposition;
__u16 netfid;
FILE_ALL_INFO *buf = NULL;
......@@ -277,6 +285,7 @@ int cifs_open(struct inode *inode, struct file *file)
cFYI(1, ("inode = 0x%p file flags are 0x%x for %s",
inode, file->f_flags, full_path));
desiredAccess = cifs_convert_flags(file->f_flags);
desiredShare = cifs_get_share_flags(file->f_flags);
/*********************************************************************
* open flag mapping table:
......@@ -326,7 +335,7 @@ int cifs_open(struct inode *inode, struct file *file)
if (cifs_sb->tcon->ses->capabilities & CAP_NT_SMBS)
rc = CIFSSMBOpen(xid, pTcon, full_path, disposition,
desiredAccess, CREATE_NOT_DIR, &netfid, &oplock, buf,
desiredAccess, desiredShare, CREATE_NOT_DIR, &netfid, &oplock, buf,
cifs_sb->local_nls, cifs_sb->mnt_cifs_flags
& CIFS_MOUNT_MAP_SPECIAL_CHR);
else
......@@ -414,6 +423,7 @@ static int cifs_reopen_file(struct file *file, int can_flush)
struct inode *inode;
char *full_path = NULL;
int desiredAccess;
int desiredShare;
int disposition = FILE_OPEN;
__u16 netfid;
......@@ -490,6 +500,7 @@ reopen_error_exit:
cFYI(1, ("inode = 0x%p file flags 0x%x for %s",
inode, file->f_flags, full_path));
desiredAccess = cifs_convert_flags(file->f_flags);
desiredShare = cifs_get_share_flags(file->f_flags);
if (oplockEnabled)
oplock = REQ_OPLOCK;
......@@ -502,7 +513,7 @@ reopen_error_exit:
and server version of file size can be stale. If we knew for sure
that inode was not dirty locally we could do this */
rc = CIFSSMBOpen(xid, pTcon, full_path, disposition, desiredAccess,
rc = CIFSSMBOpen(xid, pTcon, full_path, disposition, desiredAccess, desiredShare,
CREATE_NOT_DIR, &netfid, &oplock, NULL,
cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
CIFS_MOUNT_MAP_SPECIAL_CHR);
......
......@@ -41,13 +41,12 @@ static inline void drop_nlink(struct inode *inode)
{
inode->i_nlink--;
}
#endif
static inline void inc_nlink(struct inode *inode)
static inline void fc8_inc_nlink(struct inode *inode)
{
inode->i_nlink++;
}
#endif
int cifs_get_inode_info_unix(struct inode **pinode,
const unsigned char *search_path, struct super_block *sb, int xid)
......@@ -256,7 +255,7 @@ static int decode_sfu_inode(struct inode *inode, __u64 size,
return -EINVAL; /* EOPNOTSUPP? */
}
rc = CIFSSMBOpen(xid, pTcon, path, FILE_OPEN, GENERIC_READ,
rc = CIFSSMBOpen(xid, pTcon, path, FILE_OPEN, GENERIC_READ, FILE_SHARE_ALL,
CREATE_NOT_DIR, &netfid, &oplock, NULL,
cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags &
......@@ -665,7 +664,7 @@ psx_del_no_retry:
int oplock = FALSE;
__u16 netfid;
rc = CIFSSMBOpen(xid, pTcon, full_path, FILE_OPEN, DELETE,
rc = CIFSSMBOpen(xid, pTcon, full_path, FILE_OPEN, DELETE, FILE_SHARE_ALL,
CREATE_NOT_DIR | CREATE_DELETE_ON_CLOSE,
&netfid, &oplock, NULL, cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags &
......@@ -709,8 +708,7 @@ psx_del_no_retry:
/* BB could scan to see if we already have it open
and pass in pid of opener to function */
rc = CIFSSMBOpen(xid, pTcon, full_path,
FILE_OPEN, SYNCHRONIZE |
FILE_WRITE_ATTRIBUTES, 0,
FILE_OPEN, SYNCHRONIZE | FILE_WRITE_ATTRIBUTES, FILE_SHARE_ALL, 0,
&netfid, &oplock, NULL,
cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags &
......@@ -737,7 +735,7 @@ psx_del_no_retry:
__u16 netfid;
rc = CIFSSMBOpen(xid, pTcon, full_path,
FILE_OPEN, DELETE,
FILE_OPEN, DELETE, FILE_SHARE_ALL,
CREATE_NOT_DIR |
CREATE_DELETE_ON_CLOSE,
&netfid, &oplock, NULL,
......@@ -959,7 +957,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
}
/*BB check (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID ) to see if need
to set uid/gid */
inc_nlink(inode);
fc8_inc_nlink(inode);
if (pTcon->nocase)
direntry->d_op = &cifs_ci_dentry_ops;
else
......@@ -1009,7 +1007,7 @@ mkdir_retry_old:
d_drop(direntry);
} else {
mkdir_get_info:
inc_nlink(inode);
fc8_inc_nlink(inode);
if (pTcon->unix_ext)
rc = cifs_get_inode_info_unix(&newinode, full_path,
inode->i_sb, xid);
......@@ -1209,7 +1207,7 @@ int cifs_rename(struct inode *source_inode, struct dentry *source_direntry,
/* if renaming directory - we should not say CREATE_NOT_DIR,
need to test renaming open directory, also GENERIC_READ
might not right be right access to request */
rc = CIFSSMBOpen(xid, pTcon, fromName, FILE_OPEN, GENERIC_READ,
rc = CIFSSMBOpen(xid, pTcon, fromName, FILE_OPEN, GENERIC_READ, FILE_SHARE_ALL,
CREATE_NOT_DIR, &netfid, &oplock, NULL,
cifs_sb_source->local_nls,
cifs_sb_source->mnt_cifs_flags &
......@@ -1273,7 +1271,7 @@ int cifs_revalidate(struct dentry *direntry)
direntry->d_inode->i_count.counter, direntry,
direntry->d_time, jiffies));
if (cifsInode->time == 0) {
if (cifsInode->time == 0 || cifsInode->needForceInvalidate ) {
/* was set to zero previously to force revalidate */
} else if (time_before(jiffies, cifsInode->time + HZ) &&
lookupCacheEnabled) {
......@@ -1315,18 +1313,18 @@ int cifs_revalidate(struct dentry *direntry)
/* if not oplocked, we invalidate inode pages if mtime or file size
had changed on server */
if (timespec_equal(&local_mtime, &direntry->d_inode->i_mtime) &&
(local_size == direntry->d_inode->i_size)) {
cFYI(1, ("cifs_revalidate - inode unchanged"));
if (!cifsInode->needForceInvalidate &&
timespec_equal(&local_mtime,&direntry->d_inode->i_mtime) &&
(local_size == direntry->d_inode->i_size) ) {
cFYI(1, ("***************************** cifs_revalidate - inode unchanged"));
} else {
/* file may have changed on server */
if (cifsInode->clientCanCacheRead) {
/* no need to invalidate inode pages since we were the
only ones who could have modified the file and the
server copy is staler than ours */
} else {
} else
invalidate_inode = TRUE;
}
}
/* can not grab this sem since kernel filesys locking documentation
......@@ -1347,8 +1345,13 @@ int cifs_revalidate(struct dentry *direntry)
if (S_ISREG(direntry->d_inode->i_mode)) {
if (direntry->d_inode->i_mapping)
filemap_fdatawait(direntry->d_inode->i_mapping);
if( cifsInode->needForceInvalidate ) {
cFYI(1, ("Force invalidating."));
invalidate_remote_inode(direntry->d_inode);
cifsInode->needForceInvalidate = 0;
/* may eventually have to do this for open files too */
if (list_empty(&(cifsInode->openFileList))) {
} else if (list_empty(&(cifsInode->openFileList))) {
/* changed on server - flush read ahead pages */
cFYI(1, ("Invalidating read ahead data on "
"closed file"));
......@@ -1687,7 +1690,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
/* BB we could scan to see if we already have it open
and pass in pid of opener to function */
rc = CIFSSMBOpen(xid, pTcon, full_path, FILE_OPEN,
SYNCHRONIZE | FILE_WRITE_ATTRIBUTES,
SYNCHRONIZE | FILE_WRITE_ATTRIBUTES, FILE_SHARE_ALL,
CREATE_NOT_DIR, &netfid, &oplock,
NULL, cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags &
......
......@@ -298,7 +298,7 @@ cifs_readlink(struct dentry *direntry, char __user *pBuffer, int buflen)
cERROR(1, ("SFU style symlinks not implemented yet"));
/* add open and read as in fs/cifs/inode.c */
} else {
rc = CIFSSMBOpen(xid, pTcon, full_path, FILE_OPEN, GENERIC_READ,
rc = CIFSSMBOpen(xid, pTcon, full_path, FILE_OPEN, GENERIC_READ, FILE_SHARE_ALL,
OPEN_REPARSE_POINT, &fid, &oplock, NULL,
cifs_sb->local_nls,
cifs_sb->mnt_cifs_flags &
......
......@@ -30,6 +30,7 @@
#include "ntlmssp.h"
#include "nterr.h"
#include <linux/utsname.h>
#include <linux/autoconf.h>
extern void SMBNTencrypt(unsigned char *passwd, unsigned char *c8,
unsigned char *p24);
......@@ -117,7 +118,7 @@ static void unicode_ssetup_strings(char **pbcc_area, struct cifsSesInfo *ses,
bytes_ret = cifs_strtoUCS((__le16 *)bcc_ptr, "Linux version ", 32,
nls_cp);
bcc_ptr += 2 * bytes_ret;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18)
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18) || defined CONFIG_VE
bytes_ret = cifs_strtoUCS((__le16 *) bcc_ptr, init_utsname()->release,
32, nls_cp);
#else
......@@ -167,7 +168,7 @@ static void ascii_ssetup_strings(char **pbcc_area, struct cifsSesInfo *ses,
strcpy(bcc_ptr, "Linux version ");
bcc_ptr += strlen("Linux version ");
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18)
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 18) || defined CONFIG_VE
strcpy(bcc_ptr, init_utsname()->release);
bcc_ptr += strlen(init_utsname()->release) + 1;
#else
......
......@@ -11,33 +11,43 @@
# kernel-source-XXXX for SuSe
# kernel-source-XXXX for Slackware / MOPSLinux
%define src_package_name kernel-source-etercifs-legacy
%define src_package_version 1.50c
Name: linux-cifs
Version: 1.50c
Release: alt4
Version: 1.0
Release: alt1
Serial: 1
Summary: Advanced Common Internet File System for Linux with Etersoft extension
Packager: Vitaly Lipatov <lav@altlinux.ru>
Packager: Konstantin Baev <kipruss@altlinux.org>
License: GPL 2
License: GPLv2
Group: System/Kernel and hardware
Url: http://linux-cifs.samba.org/
Url: http://git.etersoft.ru/
BuildArch: noarch
Source: ftp://updates.etersoft.ru/pub/Etersoft/WINE@Etersoft/sources/tarball/%name-%version.tar.bz2
Source1: http://pserver.samba.org/samba/ftp/cifs-cvs/cifs-%version.tar.bz2
#Source: ftp://updates.etersoft.ru/pub/Etersoft/WINE@Etersoft/sources/tarball/%name-%version.tar.bz2
#Source1: http://pserver.samba.org/samba/ftp/cifs-cvs/cifs-%version.tar.bz2
Source: %name-%version.tar.bz2
Source1: %src_package_name-%src_package_version.tar.bz2
BuildRequires: rpm-build-compat >= 0.97
# Spec part for ALT Linux
%if %_vendor == "alt"
BuildRequires: kernel-build-tools
BuildRequires: kernel-headers-modules-std-smp kernel-headers-modules-ovz-smp kernel-headers-modules-std-def
BuildRequires: kernel-headers-modules-std-def
#BuildRequires: kernel-headers-modules-std-smp kernel-headers-modules-ovz-smp kernel-headers-modules-std-def
# do not work?
%ifarch x86_64
# Don't know if ifnarch exist
BuildRequires: kernel-headers-modules-std-smp
%else
BuildRequires: kernel-headers-modules-std-pae
#BuildRequires: kernel-headers-modules-std-pae
%endif
%endif
......@@ -49,7 +59,6 @@ AutoReq: no
%define module_dir /lib/modules/%name
ExclusiveOS: Linux
#ExclusiveArch: i586
%description
The CIFS VFS is a virtual file system for Linux to allow access to
......@@ -77,31 +86,51 @@ This package has Etersoft's patches for WINE@Etersoft sharing access support.
#cifs-bld-tmp/fs/cifs
%define intdir new-cifs-backport
%package -n %src_package_name
Version: %src_package_version
Summary: Advanced Common Internet File System for Linux with Etersoft extension - module sources
Group: Development/Kernel
BuildArch: noarch
%description -n %src_package_name
The CIFS VFS is a virtual file system for Linux to allow access to
servers and storage appliances compliant with the SNIA CIFS Specification
version 1.0 or later.
Popular servers such as Samba, Windows 2000, Windows XP and many others
support CIFS by default.
The CIFS VFS provides some support for older servers based on the more
primitive SMB (Server Message Block) protocol (you also can use the Linux
file system smbfs as an alternative for accessing these).
CIFS VFS is designed to take advantage of advanced network file system
features such as locking, Unicode (advanced internationalization),
hardlinks, dfs (hierarchical, replicated name space), distributed caching
and uses native TCP names (rather than RFC1001, Netbios names).
Unlike some other network file systems all key network function including
authentication is provided in kernel (and changes to mount and/or a mount
helper file are not required in order to enable the CIFS VFS). With the
addition of upcoming improvements to the mount helper (mount.cifs) the
CIFS VFS will be able to take advantage of the new CIFS URL specification
though.
This package has Etersoft's patches for WINE@Etersoft sharing access support.
%prep
%setup -q
tar xfj %SOURCE1
patch -s -p1 -d %intdir <%name-shared-%version.patch
%install
#export KBUILD_VERBOSE=1
MAN_DIR=%buildroot%_mandir/ INIT_DIR=%buildroot%_initdir/ SBIN_DIR=%buildroot%_sbindir/ \
INSTALL_MOD_PATH=%buildroot/lib/modules BUILDDIR=`pwd`/%intdir \
DESTDIR=%buildroot SRC_DIR=%_usrsrc/%name-%version ./build.sh
%post
%post_service %name
%start_service %name
%preun
%preun_service %name
mkdir -p %kernel_srcdir
cp %SOURCE1 %kernel_srcdir/%src_package_name-%src_package_version.tar.bz2
%files
%_initdir/%name
%_initdir/%name.outformat
/lib/modules/*
%_usrsrc/%name-%version/
%files -n %src_package_name
%attr(0644,root,root) %kernel_src/%src_package_name-%src_package_version.tar.bz2
%changelog
* Thu Aug 28 2008 Konstantin Baev <kipruss@altlinux.org> 1:1.0-alt1
- fix build on Fedora 8 (2.6.18-53)
* Thu Jan 31 2008 Vitaly Lipatov <lav@altlinux.ru> 1.50c-alt4
- fix build on Fedora 8 (2.6.18-53)
......
#
# Makefile for Linux CIFS VFS client
#
obj-$(CONFIG_CIFS) += cifs.o
cifs-objs := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o fcntl.o readdir.o ioctl.o sess.o export.o
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