aboutsummaryrefslogtreecommitdiff
path: root/fs
AgeCommit message (Collapse)AuthorFilesLines
2012-09-26switch xfs_find_handle() to fget_light()Al Viro1-3/+3
Signed-off-by: Al Viro <[email protected]>
2012-09-26switch xfs_swapext() to fget_light()Al Viro1-5/+5
Signed-off-by: Al Viro <[email protected]>
2012-09-26switch coda get_device_index() to fget_light()Al Viro1-17/+15
Signed-off-by: Al Viro <[email protected]>
2012-09-26switch btrfs_ioctl_clone() to fget_light()Al Viro1-3/+3
Signed-off-by: Al Viro <[email protected]>
2012-09-26switch timerfd_[sg]ettime(2) to fget_light()Al Viro1-8/+9
Signed-off-by: Al Viro <[email protected]>
2012-09-26switch epoll_wait(2) to fget_light()Al Viro1-3/+3
Signed-off-by: Al Viro <[email protected]>
2012-09-26switch btrfs_ioctl_snap_create_transid() to fget_light()Al Viro1-7/+7
Signed-off-by: Al Viro <[email protected]>
2012-09-26switch EXT4_IOC_MOVE_EXT to fget_light()Al Viro1-3/+3
Signed-off-by: Al Viro <[email protected]>
2012-09-26export fget_lightAl Viro1-0/+1
Signed-off-by: Al Viro <[email protected]>
2012-09-26ext4: close struct file leak on EXT4_IOC_MOVE_EXTAl Viro1-1/+2
Signed-off-by: Al Viro <[email protected]>
2012-09-26switch fchmod(2) to fget_light()Al Viro1-7/+5
Signed-off-by: Al Viro <[email protected]>
2012-09-26switch fallocate(2) to fget_light()Al Viro1-3/+3
Signed-off-by: Al Viro <[email protected]>
2012-09-26switch ftruncate(2) to fget_lightAl Viro1-5/+5
Signed-off-by: Al Viro <[email protected]>
2012-09-26namei.c: fix BS commentAl Viro1-1/+1
get_write_access() is needed for nfsd, not binfmt_aout (the latter has no business doing anything of that kind, of course) Signed-off-by: Al Viro <[email protected]>
2012-09-26don't leak O_CLOEXEC into ->f_flagsAl Viro2-2/+2
Signed-off-by: Al Viro <[email protected]>
2012-09-26procfs: Convert /proc/pid/fdinfo/ handling routines to seq-file v2Cyrill Gorcunov1-48/+64
This patch converts /proc/pid/fdinfo/ handling routines to seq-file which is needed to extend seq operations and plug in auxiliary fdinfo provides from subsystems like eventfd/eventpoll/fsnotify. Note the proc_fd_link no longer call for proc_fd_info, simply because the guts of proc_fd_info() got merged into ->show() of that seq_file Signed-off-by: Al Viro <[email protected]>
2012-09-26procfs: Move /proc/pid/fd[info] handling code to fd.[ch]Cyrill Gorcunov5-387/+416
This patch prepares the ground for further extension of /proc/pid/fd[info] handling code by moving fdinfo handling code into fs/proc/fd.c. I think such move makes both fs/proc/base.c and fs/proc/fd.c easier to read. Signed-off-by: Cyrill Gorcunov <[email protected]> Acked-by: Pavel Emelyanov <[email protected]> CC: Al Viro <[email protected]> CC: Alexey Dobriyan <[email protected]> CC: Andrew Morton <[email protected]> CC: James Bottomley <[email protected]> CC: "Aneesh Kumar K.V" <[email protected]> CC: Alexey Dobriyan <[email protected]> CC: Matthew Helsley <[email protected]> CC: "J. Bruce Fields" <[email protected]> CC: "Aneesh Kumar K.V" <[email protected]> Signed-off-by: Al Viro <[email protected]>
2012-09-26new helper: daemonize_descriptors()Al Viro1-0/+6
descriptor-related parts of daemonize, done right. As the result we simplify the locking rules for ->files - we hold task_lock in *all* cases when we modify ->files. Signed-off-by: Al Viro <[email protected]>
2012-09-26do_coredump(): make sure that descriptor table isn't sharedAl Viro1-0/+7
Signed-off-by: Al Viro <[email protected]>
2012-09-26new helper: iterate_fd()Al Viro1-0/+21
iterates through the opened files in given descriptor table, calling a supplied function; we stop once non-zero is returned. Callback gets struct file *, descriptor number and const void * argument passed to iterator. It is called with files->file_lock held, so it is not allowed to block. tty_io, netprio_cgroup and selinux flush_unauthorized_files() converted to its use. Signed-off-by: Al Viro <[email protected]>
2012-09-26make expand_files() and alloc_fd() staticAl Viro1-2/+2
no callers outside of fs/file.c left Signed-off-by: Al Viro <[email protected]>
2012-09-26take __{set,clear}_{open_fd,close_on_exec}() into fs/file.cAl Viro1-0/+20
nobody uses those outside anymore. Signed-off-by: Al Viro <[email protected]>
2012-09-26new helper: replace_fd()Al Viro2-39/+63
analog of dup2(), except that it takes struct file * as source. Signed-off-by: Al Viro <[email protected]>
2012-09-26take purely descriptor-related stuff from fcntl.c to file.cAl Viro2-128/+135
Signed-off-by: Al Viro <[email protected]>
2012-09-26take close-on-exec logics to fs/file.c, clean it up a bitAl Viro2-35/+43
... and add cond_resched() there, while we are at it. We can get large latencies as is... Signed-off-by: Al Viro <[email protected]>
2012-09-26ext4: remove unused function ext4_ext_check_cacheLukas Czerner1-39/+9
Remove unused function ext4_ext_check_cache() and merge the code back to the ext4_ext_in_cache(). Reviewed-by: Carlos Maiolino <[email protected]> Signed-off-by: Lukas Czerner <[email protected]> Signed-off-by: "Theodore Ts'o" <[email protected]>
2012-09-26take descriptor-related part of close() to file.cAl Viro2-21/+27
Signed-off-by: Al Viro <[email protected]>
2012-09-26take fget() and friends to fs/file.cAl Viro2-106/+106
Signed-off-by: Al Viro <[email protected]>
2012-09-26expose a low-level variant of fd_install() for binderAl Viro1-2/+14
Similar situation to that of __alloc_fd(); do not use unless you really have to. You should not touch any descriptor table other than your own; it's a sure sign of a really bad API design. As with __alloc_fd(), you *must* use a first-class reference to struct files_struct; something obtained by get_files_struct(some task) (let alone direct task->files) will not do. It must be either current->files, or obtained by get_files_struct(current) by the owner of that sucker and given to you. Signed-off-by: Al Viro <[email protected]>
2012-09-26move put_unused_fd() and fd_install() to fs/file.cAl Viro2-44/+44
Signed-off-by: Al Viro <[email protected]>
2012-09-26trim free_fdtable_rcu()Al Viro1-15/+2
embedded case isn't hit anymore Signed-off-by: Al Viro <[email protected]>
2012-09-26don't bother with call_rcu() in put_files_struct()Al Viro1-9/+5
At that point nobody can see us anyway; everything that looks at files_fdtable(files) is separated from the guts of put_files_struct(files) - either since files is current->files or because we fetched it under task_lock() and hadn't dropped that yet, or because we'd bumped files->count while holding task_lock()... Signed-off-by: Al Viro <[email protected]>
2012-09-26move files_struct-related bits from kernel/exit.c to fs/file.cAl Viro1-1/+99
Signed-off-by: Al Viro <[email protected]>
2012-09-26new helper: __alloc_fd()Al Viro1-4/+8
Essentially, alloc_fd() in a files_struct we own a reference to. Most of the time wanting to use it is a sign of lousy API design (such as android/binder). It's *not* a general-purpose interface; better that than open-coding its guts, but again, playing with other process' descriptor table is a sign of bad design. Signed-off-by: Al Viro <[email protected]>
2012-09-26take rlimit check to callers of expand_files()Al Viro2-7/+12
... except for one in android, where the check is different and already done in caller. No need to recalculate rlimit many times in alloc_fd() either. Signed-off-by: Al Viro <[email protected]>
2012-09-26fanotify: sanitize failure exits in copy_event_to_user()Al Viro1-39/+20
* do copy_to_user() before prepare_for_access_response(); that kills the need in remove_access_response(). * don't do fd_install() until we are past the last possible failure exit. Don't use sys_close() on cleanup side - just put_unused_fd() and fput(). Less racy that way... Signed-off-by: Al Viro <[email protected]>
2012-09-26pipe(2) - race-free error recoveryAl Viro1-9/+22
don't mess with sys_close() if copy_to_user() fails; just postpone fd_install() until we know it hasn't. Signed-off-by: Al Viro <[email protected]>
2012-09-26autofs4: don't open-code fd_install()Al Viro1-16/+2
The only difference between autofs_dev_ioctl_fd_install() and fd_install() is __set_close_on_exec() done by the latter. Just use get_unused_fd_flags(O_CLOEXEC) to allocate the descriptor and be done with that... Signed-off-by: Al Viro <[email protected]>
2012-09-26make get_unused_fd_flags() a functionAl Viro1-3/+3
... and get_unused_fd() a macro around it Signed-off-by: Al Viro <[email protected]>
2012-09-26Merge remote branch 'origin' into for-nextAl Viro81-672/+804
2012-09-26ext4: use kmem_cache_zalloc instead of kmem_cache_alloc/memsetWei Yongjun1-4/+2
Using kmem_cache_zalloc() instead of kmem_cache_alloc() and memset(). spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: "Theodore Ts'o" <[email protected]>
2012-09-26xfs: Make inode32 a remountable optionCarlos Maiolino1-1/+9
As inode64 is the default option now, and was also made remountable previously, inode32 can also be remounted on-the-fly when it is needed. Signed-off-by: Carlos Maiolino <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Mark Tinguely <[email protected]> Signed-off-by: Ben Myers <[email protected]>
2012-09-26xfs: add inode64->inode32 transition into xfs_set_inode32()Carlos Maiolino1-3/+12
To make inode32 a remountable option, xfs_set_inode32() should be able to make a transition from inode64 option, disabling inode allocation on higher AGs. Signed-off-by: Carlos Maiolino <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Mark Tinguely <[email protected]> Signed-off-by: Ben Myers <[email protected]>
2012-09-26xfs: Fix mp->m_maxagi update during inode64 remountCarlos Maiolino1-1/+1
With the changes made on xfs_set_inode64(), to make it behave as xfs_set_inode32() (now leaving to the caller the responsibility to update mp->m_maxagi), we use the return value of xfs_set_inode64() to update mp->m_maxagi during remount. Signed-off-by: Carlos Maiolino <[email protected]> Reviewed-by: Mark Tinguely <[email protected]> Signed-off-by: Ben Myers <[email protected]>
2012-09-26xfs: reduce code duplication handling inode32/64 optionsCarlos Maiolino3-62/+72
Add xfs_set_inode32() to be used to enable inode32 allocation mode. this will reduce the amount of duplicated code needed to mount/remount a filesystem with inode32 option. This patch also changes xfs_set_inode64() to return the maximum AG number that inodes can be allocated instead of set mp->m_maxagi by itself, so that the behaviour is the same as xfs_set_inode32(). This simplifies code that calls these functions and needs to know the maximum AG that inodes can be allocated in. Signed-off-by: Carlos Maiolino <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Mark Tinguely <[email protected]> Signed-off-by: Ben Myers <[email protected]>
2012-09-26xfs: make inode64 as the default allocation modeCarlos Maiolino1-0/+7
since 64-bit inodes can be accessed while using inode32, and these can also be used on 32-bit kernels, there is no reason to still keep inode32 as the default mount option. If the filesystem cannot handle 64bit inode numbers (i.e CONFIG_LBDAF is not enabled and BITS_PER_LONG == 32), XFS_MOUNT_SMALL_INUMS will still be set by default, so inode64 is not an unconditional default value. Signed-off-by: Carlos Maiolino <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Mark Tinguely <[email protected]> Signed-off-by: Ben Myers <[email protected]>
2012-09-26xfs: Fix m_agirotor reset during AG selectionCarlos Maiolino1-1/+1
xfs_ialloc_next_ag() currently resets m_agirotor when it is equal to m_maxagi: if (++mp->m_agirotor == mp->m_maxagi) mp->m_agirotor = 0; But, if for some reason mp->m_maxagi changes to a lower value than current m_agirotor, this condition will never be true, causing m_agirotor to exceed the maximum allowed value (m_maxagi). This implies mainly during lookups for xfs_perag structs in its radix tree, since the agno value used for the lookup is based on m_agirotor. An out-of-range m_agirotor may cause a lookup failure which in case will return NULL. As an example, the value of m_maxagi is decreased during inode64->inode32 remount process, case where I've found this problem. Signed-off-by: Carlos Maiolino <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Mark Tinguely <[email protected]> Signed-off-by: Ben Myers <[email protected]>
2012-09-26Make inode64 a remountable optionCarlos Maiolino1-1/+29
Actually, there is no reason about why a user must umount and mount a XFS filesystem to enable 'inode64' option. So, this patch makes this a remountable option. Signed-off-by: Carlos Maiolino <[email protected]> Reviewed-by: Brian Foster <[email protected]> Reviewed-by: Dave Chinner <[email protected]> Signed-off-by: Ben Myers <[email protected]>
2012-09-26cifs: change DOS/NT/POSIX mapping of ERRnoresourceJeff Layton2-4/+5
ERRnoresource is an ERRSRV level (aka server-side) error and means "No resources currently available for request". Currently that maps to POSIX -ENOBUFS. No NT errors map to it currently. NT_STATUS_INSUFFICIENT_RESOURCES and NT_STATUS_INSUFF_SERVER_RESOURCES are also similar in meaning. Currently the client maps those to ERRnomem, which maps to -ENOMEM in POSIX. All of these mappings seem to be quite wrong to me and are confusing for users. All of the above errors indicate problems on the server, not the client. Reporting -ENOMEM or -ENOBUFS implies that the client is running out of resources. This patch changes those mappings. The NT_* errors are changed to map to the SRV level ERRnoresource. That error is in turn changed to return -EREMOTEIO which is the only POSIX error I could find that conveys that something went wrong on the server. While we're at it, change the SMB2 equivalent error to return the same. Signed-off-by: Jeff Layton <[email protected]> Acked-by: Suresh Jayaraman <[email protected]> Signed-off-by: Steve French <[email protected]>
2012-09-26ext4: reimplement uninit extent optimization for move_extent_per_page()Dmitry Monakhov1-5/+76
Uninitialized extent may became initialized(parallel writeback task) at any moment after we drop i_data_sem, so we have to recheck extent's state after we hold page's lock and i_data_sem. If we about to change page's mapping we must hold page's lock in order to serialize other users. Signed-off-by: Dmitry Monakhov <[email protected]> Signed-off-by: "Theodore Ts'o" <[email protected]>