* smb2 work status
@ 2011-07-12 6:29 Pavel Shilovsky
[not found] ` <CAKywueQqyi6ynwoAv6Q3GzbxYJSOv7k229N3NA_y05kguqA+DQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 13+ messages in thread
From: Pavel Shilovsky @ 2011-07-12 6:29 UTC (permalink / raw)
To: linux-cifs-u79uwXL29TY76Z2rM5mHXA; +Cc: Steve French
Hi all!
Here is my last update of SMB2 code development. What now works:
1) mount/umount.
2) stat, mkdir, rmdir, rm.
3) open/reopen/close, direct read/write.
The work branch is
http://git.etersoft.ru/people/piastry/packages/?p=cifs-2.6.git;a=shortlog;h=refs/heads/smb2-dev
(rebased to current master).
Your comments are appreciated!
--
Best regards,
Pavel Shilovsky.
^ permalink raw reply [flat|nested] 13+ messages in thread[parent not found: <CAKywueQqyi6ynwoAv6Q3GzbxYJSOv7k229N3NA_y05kguqA+DQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: smb2 work status [not found] ` <CAKywueQqyi6ynwoAv6Q3GzbxYJSOv7k229N3NA_y05kguqA+DQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2011-07-16 9:29 ` Pavel Shilovsky [not found] ` <CAKywueRiuj=DrumdGMvdWX6ih8PVz4L0BL7G=LNL6CO+cEfmTQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Pavel Shilovsky @ 2011-07-16 9:29 UTC (permalink / raw) To: linux-cifs-u79uwXL29TY76Z2rM5mHXA, Jeff Layton, Christoph Hellwig Cc: Steve French 2011/7/12 Pavel Shilovsky <piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > Hi all! > > Here is my last update of SMB2 code development. What now works: > 1) mount/umount. > 2) stat, mkdir, rmdir, rm. > 3) open/reopen/close, direct read/write. > > The work branch is > http://git.etersoft.ru/people/piastry/packages/?p=cifs-2.6.git;a=shortlog;h=refs/heads/smb2-dev > (rebased to current master). > > Your comments are appreciated! > > -- > Best regards, > Pavel Shilovsky. > Jeff, Christoph, can you comment on this, please? -- Best regards, Pavel Shilovsky. ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <CAKywueRiuj=DrumdGMvdWX6ih8PVz4L0BL7G=LNL6CO+cEfmTQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: smb2 work status [not found] ` <CAKywueRiuj=DrumdGMvdWX6ih8PVz4L0BL7G=LNL6CO+cEfmTQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2011-07-16 19:28 ` Christoph Hellwig [not found] ` <20110716192811.GE26925-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> 2011-07-24 14:56 ` Pavel Shilovsky 1 sibling, 1 reply; 13+ messages in thread From: Christoph Hellwig @ 2011-07-16 19:28 UTC (permalink / raw) To: Pavel Shilovsky Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA, Jeff Layton, Christoph Hellwig, Steve French On Sat, Jul 16, 2011 at 01:29:22PM +0400, Pavel Shilovsky wrote: > Jeff, Christoph, can you comment on this, please? I really don't like all that ifdef mess. I'm not quite sure how to fix in in general, though. For the inode operations it's fairly simple: just have a different set for smb2, the only shared code is just the path_from_dentry call, so there's not much duplication. But for the rest I'm not too sure. Stubbing things out smarter would help, as would creating more helpers but I'm not sure that's going to help with everything. Also some of the big bulk commits earlier in the series add code that's pretty far from the normal Linux style, e.g. smb2pdu.c, it would be nice to at least make the new code in cifs look normal. ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <20110716192811.GE26925-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>]
* Re: smb2 work status [not found] ` <20110716192811.GE26925-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> @ 2011-07-18 15:45 ` Pavel Shilovsky [not found] ` <CAKywueSP7p3pja6FociCPXDtcSuChDdHw1JqCwxyhnqMuP5ahg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Pavel Shilovsky @ 2011-07-18 15:45 UTC (permalink / raw) To: Christoph Hellwig Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA, Jeff Layton, Steve French 2011/7/16 Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>: > On Sat, Jul 16, 2011 at 01:29:22PM +0400, Pavel Shilovsky wrote: >> Jeff, Christoph, can you comment on this, please? > > I really don't like all that ifdef mess. I'm not quite sure how to > fix in in general, though. For the inode operations it's fairly simple: > just have a different set for smb2, the only shared code is just the > path_from_dentry call, so there's not much duplication. But for the > rest I'm not too sure. Stubbing things out smarter would help, as > would creating more helpers but I'm not sure that's going to help > with everything. Also some of the big bulk commits earlier in the > series add code that's pretty far from the normal Linux style, e.g. > smb2pdu.c, it would be nice to at least make the new code in cifs > look normal. Thanks for your comments! If I understand you right, you mean to separate inode and file operations for smb2 into a different structures, set them once with ifdefs in cifs_set_ops() and keep them in smb2inode.c and smb2file.c files. As for the code style of new files - I am going to fix it soon. -- Best regards, Pavel Shilovsky. ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <CAKywueSP7p3pja6FociCPXDtcSuChDdHw1JqCwxyhnqMuP5ahg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: smb2 work status [not found] ` <CAKywueSP7p3pja6FociCPXDtcSuChDdHw1JqCwxyhnqMuP5ahg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2011-07-18 15:47 ` Christoph Hellwig [not found] ` <20110718154730.GA5822-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Christoph Hellwig @ 2011-07-18 15:47 UTC (permalink / raw) To: Pavel Shilovsky Cc: Christoph Hellwig, linux-cifs-u79uwXL29TY76Z2rM5mHXA, Jeff Layton, Steve French On Mon, Jul 18, 2011 at 07:45:01PM +0400, Pavel Shilovsky wrote: > If I understand you right, you mean to separate inode and file > operations for smb2 into a different structures, set them once with > ifdefs in cifs_set_ops() and keep them in smb2inode.c and smb2file.c > files. That's the idea. You'll really have to prototype it to check if it works out nicely. If we end up duplicating too much it might not be feasible, but fro ma quick look it should be much better. ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <20110718154730.GA5822-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>]
* Re: smb2 work status [not found] ` <20110718154730.GA5822-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> @ 2011-07-19 11:24 ` Jeff Layton 2011-07-20 14:19 ` Pavel Shilovsky 1 sibling, 0 replies; 13+ messages in thread From: Jeff Layton @ 2011-07-19 11:24 UTC (permalink / raw) To: Christoph Hellwig Cc: Pavel Shilovsky, linux-cifs-u79uwXL29TY76Z2rM5mHXA, Steve French On Mon, 18 Jul 2011 11:47:30 -0400 Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> wrote: > On Mon, Jul 18, 2011 at 07:45:01PM +0400, Pavel Shilovsky wrote: > > If I understand you right, you mean to separate inode and file > > operations for smb2 into a different structures, set them once with > > ifdefs in cifs_set_ops() and keep them in smb2inode.c and smb2file.c > > files. > > That's the idea. You'll really have to prototype it to check if it > works out nicely. If we end up duplicating too much it might not > be feasible, but fro ma quick look it should be much better. > Agreed. Once you mount, you know what protocol version you're using. There's little value in continually checking that. Another idea to consider would be to keep the same set of VFS ops, and abstract out the lower level set of protocol operations. This is the model that NFS uses for NFSv2 and 3. v4 is a bit different but it does use the same file and inode ops for some things. See, for example, nfs_v3_clientops. Even if you do take Christoph's suggestion, I think there is value in abstracting out the protocol operations as well. Better organization like this will make the code less of a pain to maintain over the long term. There are also some things in this set that really ought to be encapsulated into accessor routines. For example: + /* Don't want to modify the buffer as a side effect of this call. */ + if (server->is_smb2 == false) + smb_buffer->smb_buf_length = cpu_to_be32(smb_buf_length); +#ifdef CONFIG_CIFS_SMB2 + else + smb2_buffer->smb2_buf_length = cpu_to_be32(smb_buf_length); +#endif -- Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: smb2 work status [not found] ` <20110718154730.GA5822-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> 2011-07-19 11:24 ` Jeff Layton @ 2011-07-20 14:19 ` Pavel Shilovsky 1 sibling, 0 replies; 13+ messages in thread From: Pavel Shilovsky @ 2011-07-20 14:19 UTC (permalink / raw) To: Christoph Hellwig Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA, Jeff Layton, Steve French, Shirish Pargaonkar I updated my branch smb2-dev (with the last changes. I moved to the idea like you suggested (to keep separate calls for inode and file operations) and organized the code with callbacks in some places (cifs_iovec_read, cifs_iovec_write and cifs_reopen_file) that lets us share the code between both protocols. Next I am going to rethink cifs_get_inode_info according to this model too and start to work on buffered i/o file operations. Also, I still have not fix code style in earlier patches - going to do it too. -- Best regards, Pavel Shilovsky. ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: smb2 work status [not found] ` <CAKywueRiuj=DrumdGMvdWX6ih8PVz4L0BL7G=LNL6CO+cEfmTQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2011-07-16 19:28 ` Christoph Hellwig @ 2011-07-24 14:56 ` Pavel Shilovsky [not found] ` <CAKywueTDhS_FHtssdVbSrBiPksngYsmotU69u9S1QELnm9Vh+w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 1 sibling, 1 reply; 13+ messages in thread From: Pavel Shilovsky @ 2011-07-24 14:56 UTC (permalink / raw) To: linux-cifs-u79uwXL29TY76Z2rM5mHXA, Jeff Layton, Christoph Hellwig Cc: Steve French Hi! I updated my branch smb2-dev (http://git.etersoft.ru/people/piastry/packages?p=cifs-2.6.git;a=shortlog;h=refs/heads/smb2-dev) with the following changes: 1) rebased to v3.0. 2) buffered i/o support 3) echo support I used callbacks that let me share the common code for both protocols in direct i/o, readpage, readpages, writepage, writepages, etc. Also, I made some minor changes in demultiplex patchset (now smb2-dev branch is based on this new one). Comments/thoughts? -- Best regards, Pavel Shilovsky. ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <CAKywueTDhS_FHtssdVbSrBiPksngYsmotU69u9S1QELnm9Vh+w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: smb2 work status [not found] ` <CAKywueTDhS_FHtssdVbSrBiPksngYsmotU69u9S1QELnm9Vh+w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2011-07-26 19:41 ` Pavel Shilovsky [not found] ` <CAKywueQ2B6R7EzB2t4WDfR15Ot-x823zBzy9nQwRwZSxdpco1Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Pavel Shilovsky @ 2011-07-26 19:41 UTC (permalink / raw) To: Jeff Layton, Christoph Hellwig, Steve French, Shirish Pargaonkar Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA Updated smb2-dev branch (http://git.etersoft.ru/people/piastry/packages/?p=cifs-2.6.git;a=shortlog;h=refs/heads/smb2-dev) with the following changes: 1) rebased to current master 2) create support 3) readdir support 4) cifs_get_inode_info refactoring Also, I refactored the code a little - changed statements like if (server->is_smb2 == false) do cifs things #ifdef CONFIG_CIFS_SMB2 else do smb2 things #endif to #ifdef CONFIG_CIFS_SMB2 if (server->is_smb2) do smb2 things else #endif do cifs things that helps to avoid compiler warnings when compiling without CONFIG_CIFS_SMB2. Your comments are welcome! -- Best regards, Pavel Shilovsky. ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <CAKywueQ2B6R7EzB2t4WDfR15Ot-x823zBzy9nQwRwZSxdpco1Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: smb2 work status [not found] ` <CAKywueQ2B6R7EzB2t4WDfR15Ot-x823zBzy9nQwRwZSxdpco1Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2011-08-03 20:20 ` Pavel Shilovsky 0 siblings, 0 replies; 13+ messages in thread From: Pavel Shilovsky @ 2011-08-03 20:20 UTC (permalink / raw) To: Jeff Layton, Christoph Hellwig, Steve French, Shirish Pargaonkar Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA Updated smb2-dev branch. Changes: 1) get_file_info (and convert smb2_open and smb2_create to use it), 2) rename, 3) hardlink, 4) flush, 5) other cleanups and bugfixes. Also, I created a mirror repository on git.altlinux.org - http://git.altlinux.org/people/piastry/public/?p=cifs-2.6.git;a=shortlog;h=refs/heads/smb2-dev - due to the problems with git.etersoft.ru. Next, I am going to start working with oplocks and SMB2.1 leases related code. -- Best regards, Pavel Shilovsky. ^ permalink raw reply [flat|nested] 13+ messages in thread
* smb2 work status
@ 2011-06-02 21:10 Pavel Shilovsky
[not found] ` <BANLkTik5T2aY4V-Kp-AePZYUR+KgKCyNCA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 13+ messages in thread
From: Pavel Shilovsky @ 2011-06-02 21:10 UTC (permalink / raw)
To: Steve French; +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA
Hi!
I applied pending smb2 patches on top of current master branch and
created branch smb2-dev:
http://git.etersoft.ru/people/piastry/packages/?p=cifs-2.6.git;a=shortlog;h=refs/heads/smb2-dev
I also created another branch smb2-dev-experimental and put three
commits on top of smb2-dev - it makes mount/umount work but after some
period of time kernel crashes - I am working on fixing this now:
http://git.etersoft.ru/people/piastry/packages/?p=cifs-2.6.git;a=shortlog;h=refs/heads/smb2-dev-experimental
Any thoughts/suggestions are welcome!
--
Best regards,
Pavel Shilovsky.
^ permalink raw reply [flat|nested] 13+ messages in thread[parent not found: <BANLkTik5T2aY4V-Kp-AePZYUR+KgKCyNCA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: smb2 work status [not found] ` <BANLkTik5T2aY4V-Kp-AePZYUR+KgKCyNCA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2011-06-02 21:17 ` Steve French [not found] ` <BANLkTi=NEJ2smKXM_irraWnN6gWpzGbTvA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 13+ messages in thread From: Steve French @ 2011-06-02 21:17 UTC (permalink / raw) To: Pavel Shilovsky; +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA Great - I am looking forward to reviewing these On Thu, Jun 2, 2011 at 4:10 PM, Pavel Shilovsky <piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > Hi! > > I applied pending smb2 patches on top of current master branch and > created branch smb2-dev: > http://git.etersoft.ru/people/piastry/packages/?p=cifs-2.6.git;a=shortlog;h=refs/heads/smb2-dev > > I also created another branch smb2-dev-experimental and put three > commits on top of smb2-dev - it makes mount/umount work but after some > period of time kernel crashes - I am working on fixing this now: > http://git.etersoft.ru/people/piastry/packages/?p=cifs-2.6.git;a=shortlog;h=refs/heads/smb2-dev-experimental > > Any thoughts/suggestions are welcome! > > -- > Best regards, > Pavel Shilovsky. > -- Thanks, Steve ^ permalink raw reply [flat|nested] 13+ messages in thread
[parent not found: <BANLkTi=NEJ2smKXM_irraWnN6gWpzGbTvA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: smb2 work status [not found] ` <BANLkTi=NEJ2smKXM_irraWnN6gWpzGbTvA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2011-06-07 18:07 ` Pavel Shilovsky 0 siblings, 0 replies; 13+ messages in thread From: Pavel Shilovsky @ 2011-06-07 18:07 UTC (permalink / raw) To: Steve French; +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA I found out the problem with the kernel hanging. The problem was in query-info request - we need to set size of our buffer in a request but we had sizeof(FILE_ALL_INFO_SMB2) + sizeof(query_req) there. I removed sizeof(query_req) and expand buffer to store information about filename - (+ MAX_NAME*2). So, I rebased my branch with this and other fixes and put it on top of the current master. As the result, now I have mount/umount and stat work correctly (according to my stress mount/stat/umount test). pending cifs patches: http://git.etersoft.ru/people/piastry/packages/?p=cifs-2.6.git;a=shortlog;h=refs/heads/smb2-dev my patches: http://git.etersoft.ru/people/piastry/packages/?p=cifs-2.6.git;a=shortlog;h=refs/heads/smb2-dev-experimental As the next steps, I think we need to reconsider mid structure - now I think that having one big structure for both protocols is the best way to keep code cleaner. Also, I can start implementing inode/file operations as well. Comments? -- Best regards, Pavel Shilovsky. ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2011-08-03 20:20 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-12 6:29 smb2 work status Pavel Shilovsky
[not found] ` <CAKywueQqyi6ynwoAv6Q3GzbxYJSOv7k229N3NA_y05kguqA+DQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-16 9:29 ` Pavel Shilovsky
[not found] ` <CAKywueRiuj=DrumdGMvdWX6ih8PVz4L0BL7G=LNL6CO+cEfmTQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-16 19:28 ` Christoph Hellwig
[not found] ` <20110716192811.GE26925-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2011-07-18 15:45 ` Pavel Shilovsky
[not found] ` <CAKywueSP7p3pja6FociCPXDtcSuChDdHw1JqCwxyhnqMuP5ahg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-18 15:47 ` Christoph Hellwig
[not found] ` <20110718154730.GA5822-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2011-07-19 11:24 ` Jeff Layton
2011-07-20 14:19 ` Pavel Shilovsky
2011-07-24 14:56 ` Pavel Shilovsky
[not found] ` <CAKywueTDhS_FHtssdVbSrBiPksngYsmotU69u9S1QELnm9Vh+w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-26 19:41 ` Pavel Shilovsky
[not found] ` <CAKywueQ2B6R7EzB2t4WDfR15Ot-x823zBzy9nQwRwZSxdpco1Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-08-03 20:20 ` Pavel Shilovsky
-- strict thread matches above, loose matches on Subject: below --
2011-06-02 21:10 Pavel Shilovsky
[not found] ` <BANLkTik5T2aY4V-Kp-AePZYUR+KgKCyNCA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-06-02 21:17 ` Steve French
[not found] ` <BANLkTi=NEJ2smKXM_irraWnN6gWpzGbTvA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-06-07 18:07 ` Pavel Shilovsky
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox