* smbfs / loop: problematic or not unuseable?
@ 2004-02-16 13:46 Nico Schottelius
2004-02-16 14:53 ` Urban Widmark
0 siblings, 1 reply; 4+ messages in thread
From: Nico Schottelius @ 2004-02-16 13:46 UTC (permalink / raw)
To: linux-kernel
Hello!
While still suffering from my more or less dead harddisk I am seeing
other nice problems. I copied my blowfish encrypted partition to a samba
server. Now I want to mount it and use it:
pc-it-nico# mount
[...]
//fs2/home on /home/nico/fs2 type smbfs (rw)
pc-it-nico# mount /home/nico/fs2/home-13-Feb-2004.tar.crypt /tmp/ -o loop,encryption=blowfish
Password:
ioctl: LOOP_SET_FD: Invalid argument
Well, let's try to use a local copy:
pc-it-nico# cd ~nico/fs2
pc-it-nico# cp home-13-Feb-2004.tar.crypt ..
pc-it-nico# cd ..
pc-it-nico# mount -t xfs home-13-Feb-2004.tar.crypt scice -o loop,encryption=blowfish
pc-it-nico#
This works fine.
Just wanted to report this and ask whether this is what it should be.
Greetings,
Nico
ps: If somebody can recommened me a good manufacturer for 2.5" notebook
disks, please send me a private mail. I am looking for something
running longer than 2 months, having some performance, still beiing
not too loud :)
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: smbfs / loop: problematic or not unuseable? 2004-02-16 13:46 smbfs / loop: problematic or not unuseable? Nico Schottelius @ 2004-02-16 14:53 ` Urban Widmark 2004-02-17 11:21 ` Nico Schottelius 0 siblings, 1 reply; 4+ messages in thread From: Urban Widmark @ 2004-02-16 14:53 UTC (permalink / raw) To: Nico Schottelius; +Cc: linux-kernel On Mon, 16 Feb 2004, Nico Schottelius wrote: > Hello! > > While still suffering from my more or less dead harddisk I am seeing > other nice problems. I copied my blowfish encrypted partition to a samba > server. Now I want to mount it and use it: > > pc-it-nico# mount > [...] > //fs2/home on /home/nico/fs2 type smbfs (rw) > > pc-it-nico# mount /home/nico/fs2/home-13-Feb-2004.tar.crypt /tmp/ -o loop,encryption=blowfish > Password: > ioctl: LOOP_SET_FD: Invalid argument Yes, it is known. You can try the patch below. I don't know if there is anything more to supporting sendfile than this. smb_file_sendfile follows the same pattern as the other smb_file_* operations. /Urban diff -urN -X exclude linux-2.6.3-rc1-orig/fs/smbfs/file.c linux-2.6.3-rc1-smbfs/fs/smbfs/file.c --- linux-2.6.3-rc1-orig/fs/smbfs/file.c Mon Feb 9 19:04:47 2004 +++ linux-2.6.3-rc1-smbfs/fs/smbfs/file.c Sun Feb 15 19:14:06 2004 @@ -257,6 +257,27 @@ return status; } +static ssize_t +smb_file_sendfile(struct file *file, loff_t *ppos, + size_t count, read_actor_t actor, void __user *target) +{ + struct dentry *dentry = file->f_dentry; + ssize_t status; + + VERBOSE("file %s/%s, pos=%Ld, count=%d\n", + DENTRY_PATH(dentry), *ppos, count); + + status = smb_revalidate_inode(dentry); + if (status) { + PARANOIA("%s/%s validation failed, error=%d\n", + DENTRY_PATH(dentry), status); + goto out; + } + status = generic_file_sendfile(file, ppos, count, actor, target); +out: + return status; +} + /* * This does the "real" work of the write. The generic routine has * allocated the page, locked it, done all the page alignment stuff @@ -388,6 +409,7 @@ .open = smb_file_open, .release = smb_file_release, .fsync = smb_fsync, + .sendfile = smb_file_sendfile, }; struct inode_operations smb_file_inode_operations = diff -urN -X exclude linux-2.6.3-rc1-orig/fs/smbfs/proc.c linux-2.6.3-rc1-smbfs/fs/smbfs/proc.c --- linux-2.6.3-rc1-orig/fs/smbfs/proc.c Mon Feb 9 19:08:39 2004 +++ linux-2.6.3-rc1-smbfs/fs/smbfs/proc.c Sun Feb 15 19:16:40 2004 @@ -1015,12 +1015,6 @@ p += 19; p += 8; - /* FIXME: the request will fail if the 'tid' is changed. This - should perhaps be set just before transmitting ... */ - WSET(req->rq_header, smb_tid, server->opt.tid); - WSET(req->rq_header, smb_pid, 1); - WSET(req->rq_header, smb_uid, server->opt.server_uid); - if (server->opt.protocol > SMB_PROTOCOL_CORE) { int flags = SMB_FLAGS_CASELESS_PATHNAMES; int flags2 = SMB_FLAGS2_LONG_PATH_COMPONENTS | diff -urN -X exclude linux-2.6.3-rc1-orig/fs/smbfs/request.c linux-2.6.3-rc1-smbfs/fs/smbfs/request.c --- linux-2.6.3-rc1-orig/fs/smbfs/request.c Fri Jan 9 08:00:13 2004 +++ linux-2.6.3-rc1-smbfs/fs/smbfs/request.c Sun Feb 15 16:41:34 2004 @@ -384,6 +384,12 @@ struct smb_sb_info *server = req->rq_server; int result; + if (req->rq_bytes_sent == 0) { + WSET(req->rq_header, smb_tid, server->opt.tid); + WSET(req->rq_header, smb_pid, 1); + WSET(req->rq_header, smb_uid, server->opt.server_uid); + } + result = smb_send_request(req); if (result < 0 && result != -EAGAIN) goto out; diff -urN -X exclude linux-2.6.3-rc1-orig/fs/smbfs/smbiod.c linux-2.6.3-rc1-smbfs/fs/smbfs/smbiod.c --- linux-2.6.3-rc1-orig/fs/smbfs/smbiod.c Fri Jan 9 07:59:45 2004 +++ linux-2.6.3-rc1-smbfs/fs/smbfs/smbiod.c Sun Feb 15 16:44:07 2004 @@ -161,6 +161,9 @@ while (head != &server->xmitq) { req = list_entry(head, struct smb_request, rq_queue); head = head->next; + + WSET(req->rq_header, smb_uid, -1); + req->rq_bytes_sent = 0; if (req->rq_flags & SMB_REQ_NORETRY) { VERBOSE("aborting request %p on xmitq\n", req); req->rq_errno = -EIO; ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: smbfs / loop: problematic or not unuseable? 2004-02-16 14:53 ` Urban Widmark @ 2004-02-17 11:21 ` Nico Schottelius 2004-02-17 11:53 ` Urban Widmark 0 siblings, 1 reply; 4+ messages in thread From: Nico Schottelius @ 2004-02-17 11:21 UTC (permalink / raw) To: Urban Widmark; +Cc: Nico Schottelius, linux-kernel Works! Will it be included into the main tree? Nico Urban Widmark [Mon, Feb 16, 2004 at 03:53:28PM +0100]: > On Mon, 16 Feb 2004, Nico Schottelius wrote: > > > Hello! > > > > While still suffering from my more or less dead harddisk I am seeing > > other nice problems. I copied my blowfish encrypted partition to a samba > > server. Now I want to mount it and use it: > > > > pc-it-nico# mount > > [...] > > //fs2/home on /home/nico/fs2 type smbfs (rw) > > > > pc-it-nico# mount /home/nico/fs2/home-13-Feb-2004.tar.crypt /tmp/ -o loop,encryption=blowfish > > Password: > > ioctl: LOOP_SET_FD: Invalid argument > > Yes, it is known. You can try the patch below. > > I don't know if there is anything more to supporting sendfile than this. > smb_file_sendfile follows the same pattern as the other smb_file_* > operations. > > /Urban > > > diff -urN -X exclude linux-2.6.3-rc1-orig/fs/smbfs/file.c linux-2.6.3-rc1-smbfs/fs/smbfs/file.c > --- linux-2.6.3-rc1-orig/fs/smbfs/file.c Mon Feb 9 19:04:47 2004 > +++ linux-2.6.3-rc1-smbfs/fs/smbfs/file.c Sun Feb 15 19:14:06 2004 > @@ -257,6 +257,27 @@ > return status; > } > > +static ssize_t > +smb_file_sendfile(struct file *file, loff_t *ppos, > + size_t count, read_actor_t actor, void __user *target) > +{ > + struct dentry *dentry = file->f_dentry; > + ssize_t status; > + > + VERBOSE("file %s/%s, pos=%Ld, count=%d\n", > + DENTRY_PATH(dentry), *ppos, count); > + > + status = smb_revalidate_inode(dentry); > + if (status) { > + PARANOIA("%s/%s validation failed, error=%d\n", > + DENTRY_PATH(dentry), status); > + goto out; > + } > + status = generic_file_sendfile(file, ppos, count, actor, target); > +out: > + return status; > +} > + > /* > * This does the "real" work of the write. The generic routine has > * allocated the page, locked it, done all the page alignment stuff > @@ -388,6 +409,7 @@ > .open = smb_file_open, > .release = smb_file_release, > .fsync = smb_fsync, > + .sendfile = smb_file_sendfile, > }; > > struct inode_operations smb_file_inode_operations = > diff -urN -X exclude linux-2.6.3-rc1-orig/fs/smbfs/proc.c linux-2.6.3-rc1-smbfs/fs/smbfs/proc.c > --- linux-2.6.3-rc1-orig/fs/smbfs/proc.c Mon Feb 9 19:08:39 2004 > +++ linux-2.6.3-rc1-smbfs/fs/smbfs/proc.c Sun Feb 15 19:16:40 2004 > @@ -1015,12 +1015,6 @@ > p += 19; > p += 8; > > - /* FIXME: the request will fail if the 'tid' is changed. This > - should perhaps be set just before transmitting ... */ > - WSET(req->rq_header, smb_tid, server->opt.tid); > - WSET(req->rq_header, smb_pid, 1); > - WSET(req->rq_header, smb_uid, server->opt.server_uid); > - > if (server->opt.protocol > SMB_PROTOCOL_CORE) { > int flags = SMB_FLAGS_CASELESS_PATHNAMES; > int flags2 = SMB_FLAGS2_LONG_PATH_COMPONENTS | > diff -urN -X exclude linux-2.6.3-rc1-orig/fs/smbfs/request.c linux-2.6.3-rc1-smbfs/fs/smbfs/request.c > --- linux-2.6.3-rc1-orig/fs/smbfs/request.c Fri Jan 9 08:00:13 2004 > +++ linux-2.6.3-rc1-smbfs/fs/smbfs/request.c Sun Feb 15 16:41:34 2004 > @@ -384,6 +384,12 @@ > struct smb_sb_info *server = req->rq_server; > int result; > > + if (req->rq_bytes_sent == 0) { > + WSET(req->rq_header, smb_tid, server->opt.tid); > + WSET(req->rq_header, smb_pid, 1); > + WSET(req->rq_header, smb_uid, server->opt.server_uid); > + } > + > result = smb_send_request(req); > if (result < 0 && result != -EAGAIN) > goto out; > diff -urN -X exclude linux-2.6.3-rc1-orig/fs/smbfs/smbiod.c linux-2.6.3-rc1-smbfs/fs/smbfs/smbiod.c > --- linux-2.6.3-rc1-orig/fs/smbfs/smbiod.c Fri Jan 9 07:59:45 2004 > +++ linux-2.6.3-rc1-smbfs/fs/smbfs/smbiod.c Sun Feb 15 16:44:07 2004 > @@ -161,6 +161,9 @@ > while (head != &server->xmitq) { > req = list_entry(head, struct smb_request, rq_queue); > head = head->next; > + > + WSET(req->rq_header, smb_uid, -1); > + req->rq_bytes_sent = 0; > if (req->rq_flags & SMB_REQ_NORETRY) { > VERBOSE("aborting request %p on xmitq\n", req); > req->rq_errno = -EIO; > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: smbfs / loop: problematic or not unuseable? 2004-02-17 11:21 ` Nico Schottelius @ 2004-02-17 11:53 ` Urban Widmark 0 siblings, 0 replies; 4+ messages in thread From: Urban Widmark @ 2004-02-17 11:53 UTC (permalink / raw) To: Nico Schottelius; +Cc: linux-kernel On Tue, 17 Feb 2004, Nico Schottelius wrote: > Works! > Will it be included into the main tree? Yes, unless someone complains. Also, I'm waiting for feedback on the smb_uid part (that I didn't tell you about) so I don't think it will be in 2.6.3. /Urban ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-02-17 11:53 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2004-02-16 13:46 smbfs / loop: problematic or not unuseable? Nico Schottelius 2004-02-16 14:53 ` Urban Widmark 2004-02-17 11:21 ` Nico Schottelius 2004-02-17 11:53 ` Urban Widmark
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.