[no subject]

2014-10-15 Thread Steve French
smb3 also fails new xfstest generic/035 (as does nfs but for different
reasons) although cifs works.

Looks like need to implement a rename_pending_delete worker function
for smb2/smb2.1/smb3 (as cifs has).

-- 
Thanks,

Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[no subject]

2014-02-26 Thread Mrs. Alivia Edwin
 
 
 
 
 
 
 
 
 
  
 

 
 
 
 
 

 

  

  

I am Mrs. Alivia Edwin the wife of Engr David Edwin a Syrian Industrialist and 
member of a Syrian businessman in council Damascus. Please kindly view attache 
for more details.






























From Mrs. Alivia Edwin.doc
Description: MS-Word document


[no subject]

2013-11-16 Thread Steve French
David,
I have updated the patch as you suggested - let me know if you see
further changes needed.  I will probably wait a day or two before
sending this up since I would like to test this updated patch -
especially to do some additional perf testing and also to see if any
additional review feedback, but will send a request for the other
pending patches soon.

>From a289b96bfae816a8861ea51a97e74f54ff06f4b2 Mon Sep 17 00:00:00 2001
From: Steve French 
Date: Sat, 16 Nov 2013 18:05:28 -0600
Subject: [PATCH] CIFS: SMB2/SMB3 Copy offload support (refcopy) finish up

This third version of the patch, incorparating feedback from David Disseldorp
extends the ability of copychunk (refcopy) over smb2/smb3 mounts to
handle servers with smaller than usual maximum chunk sizes
and also to handle files bigger than the maximum chunk sizes

In the future this can be extended further to handle sending
multiple chunk requests in on SMB2 ioctl request which will
further improve performance, but even with one 1MB chunk per
request the speedup on cp is quite large.

Signed-off-by: Steve French 
---
 fs/cifs/smb2ops.c | 98 +++
 fs/cifs/smb2pdu.c |  9 -
 2 files changed, 93 insertions(+), 14 deletions(-)

diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index 11dde4b..a3968ee 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -532,7 +532,10 @@ smb2_clone_range(const unsigned int xid,
  int rc;
  unsigned int ret_data_len;
  struct copychunk_ioctl *pcchunk;
- char *retbuf = NULL;
+ struct copychunk_ioctl_rsp *retbuf = NULL;
+ struct cifs_tcon *tcon;
+ int chunks_copied = 0;
+ bool chunk_sizes_updated = false;

  pcchunk = kmalloc(sizeof(struct copychunk_ioctl), GFP_KERNEL);

@@ -547,27 +550,96 @@ smb2_clone_range(const unsigned int xid,

  /* Note: request_res_key sets res_key null only if rc !=0 */
  if (rc)
- return rc;
+ goto cchunk_out;

  /* For now array only one chunk long, will make more flexible later */
  pcchunk->ChunkCount = __constant_cpu_to_le32(1);
  pcchunk->Reserved = 0;
- pcchunk->SourceOffset = cpu_to_le64(src_off);
- pcchunk->TargetOffset = cpu_to_le64(dest_off);
- pcchunk->Length = cpu_to_le32(len);
  pcchunk->Reserved2 = 0;

- /* Request that server copy to target from src file identified by key */
- rc = SMB2_ioctl(xid, tlink_tcon(trgtfile->tlink),
- trgtfile->fid.persistent_fid,
- trgtfile->fid.volatile_fid, FSCTL_SRV_COPYCHUNK_WRITE,
- true /* is_fsctl */, (char *)pcchunk,
- sizeof(struct copychunk_ioctl), &retbuf, &ret_data_len);
+ tcon = tlink_tcon(trgtfile->tlink);

- /* BB need to special case rc = EINVAL to alter chunk size */
+ while (len > 0) {
+ pcchunk->SourceOffset = cpu_to_le64(src_off);
+ pcchunk->TargetOffset = cpu_to_le64(dest_off);
+ pcchunk->Length =
+ cpu_to_le32(min_t(u32, len, tcon->max_bytes_chunk));

- cifs_dbg(FYI, "rc %d data length out %d\n", rc, ret_data_len);
+ /* Request server copy to target from src identified by key */
+ rc = SMB2_ioctl(xid, tcon, trgtfile->fid.persistent_fid,
+ trgtfile->fid.volatile_fid, FSCTL_SRV_COPYCHUNK_WRITE,
+ true /* is_fsctl */, (char *)pcchunk,
+ sizeof(struct copychunk_ioctl), (char **)&retbuf,
+ &ret_data_len);
+ if (rc == 0) {
+ if (ret_data_len !=
+ sizeof(struct copychunk_ioctl_rsp)) {
+ cifs_dbg(VFS, "invalid cchunk response size\n");
+ rc = -EIO;
+ goto cchunk_out;
+ }
+ if (retbuf->TotalBytesWritten == 0) {
+ cifs_dbg(FYI, "no bytes copied\n");
+ rc = -EIO;
+ goto cchunk_out;
+ }
+ /*
+ * Check if server claimed to write more than we asked
+ */
+ if (le32_to_cpu(retbuf->TotalBytesWritten) >
+le32_to_cpu(pcchunk->Length)) {
+ cifs_dbg(VFS, "invalid copy chunk response\n");
+ rc = -EIO;
+ goto cchunk_out;
+ }
+ if (le32_to_cpu(retbuf->ChunksWritten) != 1) {
+ cifs_dbg(VFS, "invalid num chunks written\n");
+ rc = -EIO;
+ goto cchunk_out;
+ }
+ chunks_copied++;
+
+ src_off += le32_to_cpu(retbuf->TotalBytesWritten);
+ dest_off += le32_to_cpu(retbuf->TotalBytesWritten);
+ len -= le32_to_cpu(retbuf->TotalBytesWritten);
+
+ cifs_dbg(FYI, "Chunks %d PartialChunk %d Total %d\n",
+ le32_to_cpu(retbuf->ChunksWritten),
+ le32_to_cpu(retbuf->ChunkBytesWritten),
+ le32_to_cpu(retbuf->TotalBytesWritten));
+ } else if (rc == -EINVAL) {
+ if (ret_data_len != sizeof(struct copychunk_ioctl_rsp))
+ goto cchunk_out;
+
+ cifs_dbg(FYI, "MaxChunks %d BytesChunk %d MaxCopy %d\n",
+ le32_to_cpu(retbuf->ChunksWritten),
+ le32_to_cpu(retbuf->ChunkBytesWritten),
+ le32_to_cpu(retbuf->TotalBytesWritten));
+
+ /*
+ * Check if this is the first request using these sizes,
+ * (ie check if copy succeed once with original sizes
+ * and check if the server gave us different sizes after
+ * we already updated max sizes on previous request).
+ * if not then why is the server returning an error now
+ */
+ if ((chunks_copied != 0) || chunk_sizes_updated)
+ goto cchunk_out;
+
+ /* Check that server is not asking us to grow size */
+ if (le32_to_cpu(retbuf->ChunkBytesWritten) <
+ tcon->max_bytes_chunk)
+ tcon->max_byt

[no subject]

2013-10-17 Thread Steve French
>From 6b6503530681165dccf2ce59eb631542ec58288c Mon Sep 17 00:00:00 2001
From: Steve French 
Date: Thu, 17 Oct 2013 14:16:33 -0500
Subject: [PATCH] [CIFS] SMB2/SMB3 Copy offload support (refcopy) phase 1

This first patch adds the ability for us to do a server side copy
(ie fast copy offloaded to the server)

"cp --reflink"

of one file to another located on the same server.  This
is much faster than traditional copy (which requires
reading and writing over the network and extra
memcpys).

This first version is not going to copy
files larger than about 1MB (to Samba) until I add
support for multiple chunks and for autoconfiguring
the chunksize.  To work to Samba it requires Samba 4.1 or later and
David Disseldorp's recently posted small Samba server patch.
It does work to Windows.

It includes:
1) processing of the ioctl (IOC_CLONE, similar to btrfs)
2) marshalling and sending the SMB2/SMB3 fsctl over the network
3) simple parsing of the response

It does not include yet (these will be in followon patches to come soon):
1) support for multiple chunks
2) support for autoconfiguring and remembering the chunksize
3) Support for the older style copychunk which Samba 4.1 server supports
(because this would require read permission on the target file, which
cp does not give you, apparently per-posix).  Use of COPYCHUNK to
Samba 4.1 server (pre-david's patch) may require
a distinct tool (other than cp) and another (trivial) ioctl to implement.

Signed-off-by: Steve French 
---
 fs/cifs/cifsglob.h |   3 ++
 fs/cifs/ioctl.c| 103 +
 fs/cifs/smb2ops.c  |  82 ++
 fs/cifs/smb2pdu.h  |  15 +++-
 4 files changed, 202 insertions(+), 1 deletion(-)

diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index de3e3e0..a67cf12 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -381,6 +381,9 @@ struct smb_version_operations {
  char * (*create_lease_buf)(u8 *, u8);
  /* parse lease context buffer and return oplock/epoch info */
  __u8 (*parse_lease_buf)(void *, unsigned int *);
+ int (*clone_range)(const unsigned int, struct cifsFileInfo *src_file,
+ struct cifsFileInfo *target_file, u64 src_off, u64 len,
+ u64 dest_off);
 };

 struct smb_version_values {
diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c
index ba54bf6..d353f6c 100644
--- a/fs/cifs/ioctl.c
+++ b/fs/cifs/ioctl.c
@@ -22,12 +22,112 @@
  */

 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
 #include "cifspdu.h"
 #include "cifsglob.h"
 #include "cifsproto.h"
 #include "cifs_debug.h"
 #include "cifsfs.h"

+static long cifs_ioctl_clone(unsigned int xid, struct file *dst_file,
+ unsigned long srcfd, u64 off, u64 len, u64 destoff)
+{
+ int rc;
+ struct cifsFileInfo *smb_file_target = dst_file->private_data;
+ struct inode *target_inode = file_inode(dst_file);
+ struct cifs_tcon *target_tcon;
+ struct fd src_file;
+ struct cifsFileInfo *smb_file_src;
+ struct inode *src_inode;
+ struct cifs_tcon *src_tcon;
+
+ cifs_dbg(FYI, "ioctl clone range\n");
+ /* the destination must be opened for writing */
+ if (!(dst_file->f_mode & FMODE_WRITE)) {
+ cifs_dbg(FYI, "file target not open for write\n");
+ return -EINVAL;
+ }
+
+ /* check if target volume is readonly and take reference */
+ rc = mnt_want_write_file(dst_file);
+ if (rc) {
+ cifs_dbg(FYI, "mnt_want_write failed with rc %d\n", rc);
+ return rc;
+ }
+
+ src_file = fdget(srcfd);
+ if (!src_file.file) {
+ rc = -EBADF;
+ goto out_drop_write;
+ }
+
+ if ((!src_file.file->private_data) || (!dst_file->private_data)) {
+ rc = -EBADF;
+ cifs_dbg(VFS, "missing cifsFileInfo on copy range src file\n");
+ goto out_fput;
+ }
+
+ rc = -EXDEV;
+ smb_file_target = dst_file->private_data;
+ smb_file_src = src_file.file->private_data;
+ src_tcon = tlink_tcon(smb_file_src->tlink);
+ target_tcon = tlink_tcon(smb_file_target->tlink);
+
+ /* check if source and target are on same tree connection */
+ if (src_tcon != target_tcon) {
+ cifs_dbg(VFS, "file copy src and target on different volume\n");
+ goto out_fput;
+ }
+
+ src_inode = src_file.file->f_dentry->d_inode;
+
+ /* Note: cifs case is easier than btrfs since server responsible for */
+ /* checks for proper open modes and file type and if it wants */
+ /* server could even support copy of range where source = target */
+
+ /* so we do not deadlock racing two ioctls on same files */
+ /* btrfs does a similar check */
+ if (target_inode < src_inode) {
+ mutex_lock_nested(&target_inode->i_mutex, I_MUTEX_PARENT);
+ mutex_lock_nested(&src_inode->i_mutex, I_MUTEX_CHILD);
+ } else {
+ mutex_lock_nested(&src_inode->i_mutex, I_MUTEX_PARENT);
+ mutex_lock_nested(&target_inode->i_mutex, I_MUTEX_CHILD);
+ }
+
+ /* determine range to clone */
+ rc = -EINVAL;
+ if (off + len > src_inode->i_size || off + len < off)
+ goto out_unlock;
+ if (len == 0)
+ len = src_inode->i_size - off;
+
+ cifs_dbg(FYI, "about to flush pages\n");
+ /* should we flush first and last page first */
+ trunca

[no subject]

2013-06-20 Thread Erric FU.
Please do contact me, we need to discuss about Aldrich
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[no subject]

2013-06-17 Thread AFG GTBANK LOAN



Loan Syndicacion

Am AFG Guaranty Trust Bank, zu strukturieren wir Kreditlinien treffen Sie
unsere
Kunden spezifischen geschäftlichen Anforderungen und einen deutlichen
Mehrwert für unsere
Kunden Unternehmen.
eine Division der AFG Finance und Private Bank plc.

Wenn Sie erwägen, eine große Akquisition oder ein Großprojekt sind, können
Sie
brauchen eine erhebliche Menge an Kredit. AFG Guaranty Trust Bank setzen
können
zusammen das Syndikat, das die gesamte Kredit schnürt für
Sie.


Als Bank mit internationaler Reichweite, sind wir gekommen, um Darlehen zu
identifizieren
Syndizierungen als Teil unseres Kerngeschäfts und durch spitzte diese Zeile
aggressiv sind wir an einem Punkt, wo wir kommen, um als erkannt haben
Hauptakteur in diesem Bereich.


öffnen Sie ein Girokonto heute mit einem Minimum Bankguthaben von 500 £ und
Getup zu £ 10.000 als Darlehen und auch den Hauch einer Chance und gewann
die Sterne
Preis von £ 500.000 in die sparen und gewinnen promo in may.aply jetzt.


mit dem Folowing Informationen über Rechtsanwalt steven lee das Konto
Offizier.


FULL NAME;


Wohnadresse;


E-MAIL-ADRESSE;

Telefonnummer;

Nächsten KINS;

MUTTER MAIDEN NAME;


Familienstand;


BÜROADRESSE;

ALTERNATIVE Telefonnummer;

TO @ yahoo.com bar.stevenlee
NOTE; ALLE Darlehen sind für 10JAHRE RATE VALID
ANGEBOT ENDET BALD SO JETZT HURRY

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[no subject]

2012-03-01 Thread Steve French
Turns out it is easy to negotiate SMB2.2 against Windows 8 (rather
than just 2.1 or 2.0 as Pavel's current git tree does).  Basic
operations worked fine.  SMB2.2 is a very cool protocol, but since
most features are optional, upgrading to SMB2.2 is not bad.  For
example this change to Pavel's git tree is trivial:

diff -U 4 fs/smb2/smb2pdu.c fs/cifs/smb2pdu.c
--- fs/smb2/smb2pdu.c   2012-03-01 18:30:24.986486510 -0600
+++ fs/cifs/smb2pdu.c   2012-03-01 18:33:35.066765305 -0600
@@ -357,20 +357,22 @@
else if (resp_buftype == CIFS_LARGE_BUFFER)
cifs_buf_release(pSMB2r);
 }

-#define SMB2_NUM_PROT 2
+#define SMB2_NUM_PROT 3

 #define SMB2_PROT   0
 #define SMB21_PROT  1
+#define SMB22_PROT  2
 #define BAD_PROT 0x

 static struct {
int index;
__le16 name;
 } smb2protocols[] = {
{SMB2_PROT,  cpu_to_le16(SMB2_PROT_ID)},
{SMB21_PROT, cpu_to_le16(SMB21_PROT_ID)},
+   {SMB22_PROT, cpu_to_le16(SMB22_PROT_ID)},
{BAD_PROT,   cpu_to_le16(BAD_PROT_ID)}
 };

 /*
@@ -464,9 +466,11 @@
}

cFYI(1, "mode 0x%x", pSMB2r->SecurityMode);

-   if (pSMB2r->DialectRevision == smb2protocols[SMB21_PROT].name)
+   if (pSMB2r->DialectRevision == smb2protocols[SMB22_PROT].name)
+   cFYI(1, "negotiated smb2.2 dialect");
+   else if (pSMB2r->DialectRevision == smb2protocols[SMB21_PROT].name)
cFYI(1, "negotiated smb2.1 dialect");
else if (pSMB2r->DialectRevision == smb2protocols[SMB2_PROT].name)
cFYI(1, "negotiated smb2 dialect");
else {
diff -U 4 fs/smb2/smb2pdu.h fs/cifs/smb2pdu.h
--- fs/smb2/smb2pdu.h   2012-03-01 18:30:24.986486510 -0600
+++ fs/cifs/smb2pdu.h   2012-03-01 18:32:11.896643315 -0600
@@ -38,8 +38,10 @@
  */

 #define SMB2_PROT_ID  0x0202
 #define SMB21_PROT_ID 0x0210
+#define SMB22_PROT_ID 0x0224
+
 #define BAD_PROT_ID   0x

 /* List is sent on wire as little endian */
 #define SMB2_NEGOTIATE cpu_to_le16(0x)

-- 
Thanks,

Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[no subject]

2011-12-27 Thread Carlos Maiolino
subscribe
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[no subject]

2011-11-28 Thread Victor Augusto Sánchez Ramírez
Hello:
I have the next situation, in linux Red Hat Enterprise 5.7   I can
mount successfuly a  windows 2003 share by doing,

$  mount.cifs Windows2003server\\testcifs /root/cifs/ -o user=user
Password:
$

when I want to see the changes in a  file on that server I commonly use:

$ tail -f /root/cifs/Test.txt


now whe I do a change in file Test.txt in the windows machine, I am
not able to seen the changes in the Linux Box until I type the tail -f
command again.

The question is: Is this a normal behavior or there exists an option
in mount.cifs or kernel module that let me see the changes in a real
time way with  tail -f?

I already read the man page and doing some google but no answer so far.

My versions are:

Redhat Enterprise 5.7
samba-client-3.0.33-3.29.el5_
6.2
kernel: 2.6.18-238.el5

Greetings
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[no subject]

2011-06-27 Thread Werner Maes
Set linux-cifs-client nomail
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[no subject]

2010-09-07 Thread shirishpargaonkar
Subject: [PATCH 0/8] ntlmv2 within ntlmssp - enable and sign using crypto apis

Three major functionality changes


Make NTLMv2 as a default authentication mechanism within NTLMSSP

Enable cifs/smb signing

Use Crypto sync hash APIs instead of cifs crypto functions to genereate
various hashes such as arc4/rc4, md5, and hmac-md5 used during authentication
and smb/cifs signature generation

Signed-off-by: Shirish Pargaonkar 
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html