Skip to content

Commit

Permalink
[PATCH] cifs: Missing initialization for largeBuf flag left out of pr…
Browse files Browse the repository at this point in the history
…evious changeset

Signed-off-by: Steve French (sfrench@us.ibm.com)
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Steve French authored and Linus Torvalds committed Apr 29, 2005
1 parent b8643e1 commit 099a58f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
6 changes: 5 additions & 1 deletion fs/cifs/CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ cifs_close. Add mount option for remapping reserved characters in
filenames (also allow recognizing files with created by SFU which have any
of these seven reserved characters, except backslash, to be recognized).
Fix invalid transact2 message (we were sometimes trying to interpret
oplock breaks as SMB responses).
oplock breaks as SMB responses). Add ioctl for checking that the
current uid matches the uid of the mounter (needed by umount.cifs).
Reduce the number of large buffer allocations in cifs response processing
(significantly reduces memory pressure under heavy stress with multiple
processes accessing the same server at the same time).

Version 1.31
------------
Expand Down
19 changes: 18 additions & 1 deletion fs/cifs/README
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Allowing User Mounts
====================
To permit users to mount and unmount over directories they own is possible
with the cifs vfs. A way to enable such mounting is to mark the mount.cifs
utility as suid (e.g. "chmod +s /sbin/mount/cifs). To enable users to
utility as suid (e.g. "chmod +s /sbin/mount.cifs). To enable users to
umount shares they mount requires
1) mount.cifs version 1.4 or later
2) an entry for the share in /etc/fstab indicating that a user may
Expand All @@ -97,6 +97,23 @@ mount.cifs with the following flag:
There is a corresponding manual page for cifs mounting in the Samba 3.0 and
later source tree in docs/manpages/mount.cifs.8

Allowing User Unmounts
======================
To permit users to ummount directories that they have user mounted (see above),
the utility umount.cifs may be used. It may be invoked directly, or if
umount.cifs is placed in /sbin, umount -i can invoke the cifs umount helper
(at least for most versions of the umount utility) for umount of cifs
mounts. As with mount.cifs, to enable user unmounts umount.cifs must be marked
as suid (e.g. "chmod +s /sbin/umount.cifs"). For this utility to succeed
the target path must be a cifs mount, and the uid of the current user must
match the uid of the user who mounted the resource.

Also note that the customary way of allowing user mounts and unmounts is
(instead of using mount.cifs and unmount.cifs as suid) to add a line
to the file /etc/fstab for each //server/share you wish to mount, but
this can become unwieldy when potential mount targets include many
or unpredictable UNC names.

Samba Considerations
====================
To get the maximum benefit from the CIFS VFS, we recommend using a server that
Expand Down
4 changes: 4 additions & 0 deletions fs/cifs/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,10 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
smb_buffer;
mid_entry->midState =
MID_RESPONSE_RECEIVED;
if(isLargeBuf)
mid_entry->largeBuf = 1;
else
mid_entry->largeBuf = 0;
}
}
spin_unlock(&GlobalMid_Lock);
Expand Down

0 comments on commit 099a58f

Please sign in to comment.