aboutsummaryrefslogtreecommitdiffstats
path: root/fs (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-10-29braino in internal.hAl Viro1-1/+1
wrong return type... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29convert simple cases of nfs-related ->get_sb() to ->mount()Al Viro1-50/+46
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29convert btrfsAl Viro1-9/+6
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29convert cephAl Viro1-23/+27
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29convert gfs2Al Viro1-29/+22
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29convert afsAl Viro1-12/+7
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29convert ecryptfsAl Viro1-7/+5
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29convert sysfsAl Viro1-19/+13
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29switch get_sb_ns() usersAl Viro1-8/+6
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29switch procfs to ->mount()Al Viro1-7/+6
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29setting ->proc_mnt doesn't belong in proc_get_sb()Al Viro1-1/+2
take that to kern_mount_data()-using callers Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29convert cifsAl Viro1-8/+7
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29convert nilfsAl Viro1-9/+7
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29switch logfs to ->mount()Al Viro2-27/+23
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29logfs: fix a leak in get_sbAl Viro4-7/+8
a) switch ->put_device() to logfs_super * b) actually call it on early failures in logfs_get_sb_device() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29logfs get_sb, part 3Al Viro4-39/+29
take logfs_get_sb_device() calls to logfs_get_sb() itself Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29logfs get_sb, part 2Al Viro4-14/+13
take setting s_bdev/s_mtd/s_devops to callers of logfs_get_sb_device(), don't bother passing them separately Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29logfs get_sb massage, part 1Al Viro4-21/+39
move allocation of logfs_super to logfs_get_sb, pass it to logfs_get_sb_...(). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29convert v9fsAl Viro1-12/+10
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29convert ubifsAl Viro1-7/+6
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29convert get_sb_pseudo() usersAl Viro4-23/+18
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29convert get_sb_nodev() usersAl Viro11-53/+65
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29convert get_sb_single() usersAl Viro8-49/+58
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29convert get_sb_mtd() users to ->mount()Al Viro2-14/+12
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29new helper: mount_bdev()Al Viro30-161/+147
... and switch of the obvious get_sb_bdev() users to ->mount() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29beginning of transtion: ->mount()Al Viro1-3/+14
eventual replacement for ->get_sb() - does *not* get vfsmount, return ERR_PTR(error) or root of subtree to be mounted. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29fix open/umount raceAl Viro2-3/+5
nameidata_to_filp() drops nd->path or transfers it to opened file. In the former case it's a Bad Idea(tm) to do mnt_drop_write() on nd->path.mnt, since we might race with umount and vfsmount in question might be gone already. Fix: don't drop it, then... IOW, have nameidata_to_filp() grab nd->path in case it transfers it to file and do path_drop() in callers. After they are through with accessing nd->path... Reported-by: Miklos Szeredi <miklos@szeredi.hu> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29a couple of open-coded ihold() introduced by nfs mergeAl Viro1-2/+2
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29cifs: Cleanup and thus reduce smb session structure and fields used during authenticationShirish Pargaonkar4-47/+55
Removed following fields from smb session structure cryptkey, ntlmv2_hash, tilen, tiblob and ntlmssp_auth structure is allocated dynamically only if the auth mech in NTLMSSP. response field within a session_key structure is used to initially store the target info (either plucked from type 2 challenge packet in case of NTLMSSP or fabricated in case of NTLMv2 without extended security) and then to store Message Authentication Key (mak) (session key + client response). Server challenge or cryptkey needed during a NTLMSSP authentication is now part of ntlmssp_auth structure which gets allocated and freed once authenticaiton process is done. Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
2010-10-29NTLM auth and sign - Use appropriate server challengeShirish Pargaonkar5-12/+21
Need to have cryptkey or server challenge in smb connection (struct TCP_Server_Info) for ntlm and ntlmv2 auth types for which cryptkey (Encryption Key) is supplied just once in Negotiate Protocol response during an smb connection setup for all the smb sessions over that smb connection. For ntlmssp, cryptkey or server challenge is provided for every smb session in type 2 packet of ntlmssp negotiation, the cryptkey provided during Negotiation Protocol response before smb connection does not count. Rename cryptKey to cryptkey and related changes. Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
2010-10-28Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4Linus Torvalds1-7/+5
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: ext4: BUG_ON fix: check if page has buffers before calling page_buffers()
2010-10-28Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6Linus Torvalds4-5/+11
* 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6: nfs4: The difference of 2 pointers is ptrdiff_t nfs: testing the wrong variable nfs: handle lock context allocation failures in nfs_create_request Fixed Regression in NFS Direct I/O path
2010-10-28ext4: BUG_ON fix: check if page has buffers before calling page_buffers() Theodore Ts'o1-7/+5
We need to make check if a page does not have buffes by checking page_has_buffers(page) before calling page_buffers(page) in ext4_writepage(). Otherwise page_buffers() could throw a BUG_ON. Thanks also to Markus Trippelsdorf and Avinash Kurup who also reported the problem. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Reported-by: Sedat Dilek <sedat.dilek@googlemail.com> Tested-by: Sedat Dilek <sedat.dilek@googlemail.com>
2010-10-28fs/notify/fanotify/fanotify_user.c: fix warningsAndrew Morton1-3/+2
fs/notify/fanotify/fanotify_user.c: In function 'fanotify_release': fs/notify/fanotify/fanotify_user.c:375: warning: unused variable 'lre' fs/notify/fanotify/fanotify_user.c:375: warning: unused variable 're' this is really ugly. Cc: Eric Paris <eparis@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Eric Paris <eparis@redhat.com>
2010-10-28fanotify: do not recalculate the mask if the ignored mask changedEric Paris1-3/+3
If fanotify sets a new bit in the ignored mask it will cause the generic fsnotify layer to recalculate the real mask. This is stupid since we didn't change that part. Signed-off-by: Eric Paris <eparis@redhat.com>
2010-10-28fanotify: ignore events on directories unless specifically requestedEric Paris2-0/+17
fanotify has a very limited number of events it sends on directories. The usefulness of these events is yet to be seen and still we send them. This is particularly painful for mount marks where one might receive many of these useless events. As such this patch will drop events on IS_DIR() inodes unless they were explictly requested with FAN_ON_DIR. This means that a mark on a directory without FAN_EVENT_ON_CHILD or FAN_ON_DIR is meaningless and will result in no events ever (although it will still be allowed since detecting it is hard) Signed-off-by: Eric Paris <eparis@redhat.com>
2010-10-28fsnotify: rename FS_IN_ISDIR to FS_ISDIREric Paris1-1/+1
The _IN_ in the naming is reserved for flags only used by inotify. Since I am about to use this flag for fanotify rename it to be generic like the rest. Signed-off-by: Eric Paris <eparis@redhat.com>
2010-10-28fanotify: do not send events for irregular filesEric Paris1-5/+6
fanotify_should_send_event has a test to see if an object is a file or directory and does not send an event otherwise. The problem is that the test is actually checking if the object with a mark is a file or directory, not if the object the event happened on is a file or directory. We should check the latter. Signed-off-by: Eric Paris <eparis@redhat.com>
2010-10-28fanotify: limit number of listeners per userEric Paris2-1/+21
fanotify currently has no limit on the number of listeners a given user can have open. This patch limits the total number of listeners per user to 128. This is the same as the inotify default limit. Signed-off-by: Eric Paris <eparis@redhat.com>
2010-10-28fanotify: allow userspace to override max marksEric Paris1-1/+8
Some fanotify groups, especially those like AV scanners, will need to place lots of marks, particularly ignore marks. Since ignore marks do not pin inodes in cache and are cleared if the inode is removed from core (usually under memory pressure) we expose an interface for listeners, with CAP_SYS_ADMIN, to override the maximum number of marks and be allowed to set and 'unlimited' number of marks. Programs which make use of this feature will be able to OOM a machine. Signed-off-by: Eric Paris <eparis@redhat.com>
2010-10-28fanotify: limit the number of marks in a single fanotify groupEric Paris1-0/+9
There is currently no limit on the number of marks a given fanotify group can have. Since fanotify is gated on CAP_SYS_ADMIN this was not seen as a serious DoS threat. This patch implements a default of 8192, the same as inotify to work towards removing the CAP_SYS_ADMIN gating and eliminating the default DoS'able status. Signed-off-by: Eric Paris <eparis@redhat.com>
2010-10-28fanotify: allow userspace to override max queue depthEric Paris1-1/+8
fanotify has a defualt max queue depth. This patch allows processes which explicitly request it to have an 'unlimited' queue depth. These processes need to be very careful to make sure they cannot fall far enough behind that they OOM the box. Thus this flag is gated on CAP_SYS_ADMIN. Signed-off-by: Eric Paris <eparis@redhat.com>
2010-10-28fsnotify: implement a default maximum queue depthEric Paris1-0/+4
Currently fanotify has no maximum queue depth. Since fanotify is CAP_SYS_ADMIN only this does not pose a normal user DoS issue, but it certianly is possible that an fanotify listener which can't keep up could OOM the box. This patch implements a default 16k depth. This is the same default depth used by inotify, but given fanotify's better queue merging in many situations this queue will contain many additional useful events by comparison. Signed-off-by: Eric Paris <eparis@redhat.com>
2010-10-28fanotify: ignore fanotify ignore marks if open writersEric Paris1-0/+10
fanotify will clear ignore marks if a task changes the contents of an inode. The problem is with the races around when userspace finishes checking a file and when that result is actually attached to the inode. This race was described as such: Consider the following scenario with hostile processes A and B, and victim process C: 1. Process A opens new file for writing. File check request is generated. 2. File check is performed in userspace. Check result is "file has no malware". 3. The "permit" response is delivered to kernel space. 4. File ignored mark set. 5. Process A writes dummy bytes to the file. File ignored flags are cleared. 6. Process B opens the same file for reading. File check request is generated. 7. File check is performed in userspace. Check result is "file has no malware". 8. Process A writes malware bytes to the file. There is no cached response yet. 9. The "permit" response is delivered to kernel space and is cached in fanotify. 10. File ignored mark set. 11. Now any process C will be permitted to open the malware file. There is a race between steps 8 and 10 While fanotify makes no strong guarantees about systems with hostile processes there is no reason we cannot harden against this race. We do that by simply ignoring any ignore marks if the inode has open writers (aka i_writecount > 0). (We actually do not ignore ignore marks if the FAN_MARK_SURV_MODIFY flag is set) Reported-by: Vasily Novikov <vasily.novikov@kaspersky.com> Signed-off-by: Eric Paris <eparis@redhat.com>
2010-10-28fsnotify: call fsnotify_parent in perm eventsEric Paris1-6/+9
fsnotify perm events do not call fsnotify parent. That means you cannot register a perm event on a directory and enforce permissions on all inodes in that directory. This patch fixes that situation. Signed-off-by: Eric Paris <eparis@redhat.com>
2010-10-28fsnotify: correctly handle return codes from listenersEric Paris1-8/+12
When fsnotify groups return errors they are ignored. For permissions events these should be passed back up the stack, but for most events these should continue to be ignored. Signed-off-by: Eric Paris <eparis@redhat.com>
2010-10-28fanotify: implement fanotify listener orderingEric Paris1-1/+24
The fanotify listeners needs to be able to specify what types of operations they are going to perform so they can be ordered appropriately between other listeners doing other types of operations. They need this to be able to make sure that things like hierarchichal storage managers will get access to inodes before processes which need the data. This patch defines 3 possible uses which groups must indicate in the fanotify_init() flags. FAN_CLASS_PRE_CONTENT FAN_CLASS_CONTENT FAN_CLASS_NOTIF Groups will receive notification in that order. The order between 2 groups in the same class is undeterministic. FAN_CLASS_PRE_CONTENT is intended to be used by listeners which need access to the inode before they are certain that the inode contains it's final data. A hierarchical storage manager should choose to use this class. FAN_CLASS_CONTENT is intended to be used by listeners which need access to the inode after it contains its intended contents. This would be the appropriate level for an AV solution or document control system. FAN_CLASS_NOTIF is intended for normal async notification about access, much the same as inotify and dnotify. Syncronous permissions events are not permitted at this class. Signed-off-by: Eric Paris <eparis@redhat.com>
2010-10-28fsnotify: implement ordering between notifiersEric Paris2-3/+12
fanotify needs to be able to specify that some groups get events before others. They use this idea to make sure that a hierarchical storage manager gets access to files before programs which actually use them. This is purely infrastructure. Everything will have a priority of 0, but the infrastructure will exist for it to be non-zero. Signed-off-by: Eric Paris <eparis@redhat.com>
2010-10-28fanotify: allow fanotify to be builtEric Paris1-1/+1
We disabled the ability to build fanotify in commit 7c5347733dcc4ba0ba. This reverts that commit and allows people to build fanotify. Signed-off-by: Eric Paris <eparis@redhat.com>
2010-10-28Btrfs: create special free space cache inodeJosef Bacik10-46/+668
In order to save free space cache, we need an inode to hold the data, and we need a special item to point at the right inode for the right block group. So first, create a special item that will point to the right inode, and the number of extent entries we will have and the number of bitmaps we will have. We truncate and pre-allocate space everytime to make sure it's uptodate. This feature will be turned on as soon as you mount with -o space_cache, however it is safe to boot into old kernels, they will just generate the cache the old fashion way. When you boot back into a newer kernel we will notice that we modified and not the cache and automatically discard the cache. Signed-off-by: Josef Bacik <josef@redhat.com>