aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2010-05-21ocfs2: Fix lock inversion in quotas during umountJan Kara2-4/+4
We cannot cancel delayed work from ocfs2_local_free_info because that is called with dqonoff_mutex held and the work it cancels requires dqonoff_mutex to finish. Cancel the work before acquiring dqonoff_mutex. Acked-by: Joel Becker <Joel.Becker@oracle.com> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21ocfs2: Use __dquot_transfer to avoid lock inversionJan Kara1-12/+5
dquot_transfer() acquires own references to dquots via dqget(). Thus it waits for dq_lock which creates a lock inversion because dq_lock ranks above transaction start but transaction is already started in ocfs2_setattr(). Fix the problem by passing own references directly to __dquot_transfer. Acked-by: Joel Becker <Joel.Becker@oracle.com> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21ocfs2: Fix NULL pointer deref when writing local dquotJan Kara3-12/+12
commit_dqblk() can write quota info to global file. That is actually a bad thing to do because if we are just modifying local quota file, we are not prepared (do not hold proper locks, do not have transaction credits) to do a modification of the global quota file. So do not use commit_dqblk() and instead call our writing function directly. Acked-by: Joel Becker <Joel.Becker@oracle.com> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21ocfs2: Fix estimate of credits needed for quota allocationJan Kara1-2/+3
We were missing reservation of a journal credit for modification of quota file inode when creating new dquot structure in the global quota file. Acked-by: Joel Becker <Joel.Becker@oracle.com> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21ocfs2: Fix quota lockingJan Kara3-186/+214
OCFS2 had three issues with quota locking: a) When reading dquot from global quota file, we started a transaction while holding dqio_mutex which is prone to deadlocks because other paths do it the other way around b) During ocfs2_sync_dquot we were not protected against concurrent writers on the same node. Because we first copy data to local buffer, a race could happen resulting in old data being written to global quota file and thus causing quota inconsistency after a crash. c) ip_alloc_sem of quota files was acquired while a transaction is started in ocfs2_quota_write which can deadlock because we first get ip_alloc_sem and then start a transaction when extending quota files. We fix the problem a) by pulling all necessary code to ocfs2_acquire_dquot and ocfs2_release_dquot. Thus we no longer depend on generic dquot_acquire to do the locking and can force proper lock ordering. Problems b) and c) are fixed by locking i_mutex and ip_alloc_sem of global quota file in ocfs2_lock_global_qf and removing ip_alloc_sem from ocfs2_quota_read and ocfs2_quota_write. Acked-by: Joel Becker <Joel.Becker@oracle.com> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21ocfs2: Avoid unnecessary block mapping when refreshing quota infoJan Kara4-7/+24
The position of global quota file info does not change. So we do not have to do logical -> physical block translation every time we reread it from disk. Thus we can also avoid taking ip_alloc_sem. Acked-by: Joel Becker <Joel.Becker@oracle.com> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21ocfs2: Do not map blocks from local quota file on each writeJan Kara3-9/+36
There is no need to map offset of local dquot structure to on disk block in each quota write. It is enough to map it just once and store the physical block number in quota structure in memory. Moreover this simplifies locking as we do not have to take ip_alloc_sem from quota write path. Acked-by: Joel Becker <Joel.Becker@oracle.com> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21quota: Refactor dquot_transfer code so that OCFS2 can pass in its referencesJan Kara2-35/+27
Currently, __dquot_transfer() acquires its own references of dquot structures that will be put into inode. But for OCFS2, this creates a lock inversion between dq_lock (waited on in dqget) and transaction start (started in ocfs2_setattr). Currently, deadlock is impossible because dq_lock is acquired only during dquot_acquire and dquot_release and we already hold a reference to dquot structures in ocfs2_setattr so neither of these functions can be called while we call dquot_transfer. But this is rather subtle and it is hard to teach lockdep about it. So provide __dquot_transfer function that can be passed dquot references directly. OCFS2 can then pass acquired dquot references directly to __dquot_transfer with proper locking. Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21quota: unify quota init condition in setattrDmitry Monakhov10-15/+23
Quota must being initialized if size or uid/git changes requested. But initialization performed in two different places: in case of i_size file system is responsible for dquot init , but in case of uid/gid init will be called internally in dquot_transfer(). This ambiguity makes code harder to understand. Let's move this logic to one common helper function. Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21quota: remove sb_has_quota_active in get/set_infoChristoph Hellwig1-4/+0
The methods already do these checks, so remove them in the quotactl implementation to allow non-VFS quota implementations to also support these calls. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21quota: unify ->set_dqblkChristoph Hellwig8-40/+98
Pass the larger struct fs_disk_quota to the ->set_dqblk operation so that the Q_SETQUOTA and Q_XSETQUOTA operations can be implemented with a single filesystem operation and we can retire the ->set_xquota operation. The additional information (RT-subvolume accounting and warn counts) are left zero for the VFS quota implementation. Add new fieldmask values for setting the numer of blocks and inodes values which is required for the VFS quota, but wasn't for XFS. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21quota: unify ->get_dqblkChristoph Hellwig6-24/+42
Pass the larger struct fs_disk_quota to the ->get_dqblk operation so that the Q_GETQUOTA and Q_XGETQUOTA operations can be implemented with a single filesystem operation and we can retire the ->get_xquota operation. The additional information (RT-subvolume accounting and warn counts) are left zero for the VFS quota implementation. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21ext3: make barrier options consistent with ext4Eric Sandeen2-9/+39
ext4 was updated to accept barrier/nobarrier mount options in addition to the older barrier=0/1. The barrier story is complex enough, we should help people by making the options the same at least, even if the defaults are different. This patch allows the barrier/nobarrier mount options for ext3, while keeping nobarrier the default. It also unconditionally displays barrier status in show_options, and prints a message at mount time if barriers are not enabled, just as ext4 does. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21quota: Make quota stat accounting lockless.Dmitry Monakhov4-46/+106
Quota stats is mostly writable data structure. Let's alloc percpu bucket for each value. NOTE: dqstats_read() function is racy against dqstats_{inc,dec} and may return inconsistent value. But this is ok since absolute accuracy is not required. Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21suppress warning: "quotatypes" defined but not usedSergey Senozhatsky1-0/+2
Suppress compilation warning: "quotatypes" defined but not used. quotatypes is used only when CONFIG_QUOTA_DEBUG or CONFIG_PRINT_QUOTA_WARNING is/are defined. Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21ext3: Fix waiting on transaction during fsyncJan Kara2-12/+10
log_start_commit() returns 1 only when it started a transaction commit. Thus in case transaction commit is already running, we fail to wait for the commit to finish. Fix the issue by always waiting for the commit regardless of the log_start_commit return value. Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21jbd: Provide function to check whether transaction will issue data barrierJan Kara3-2/+42
Provide a function which returns whether a transaction with given tid will send a barrier to the filesystem device. The function will be used by ext3 to detect whether fsync needs to send a separate barrier or not. Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21ufs: add ufs speciffic ->setattr callDmitry Monakhov5-3/+13
generic setattr not longer responsible for quota transfer. use ufs_setattr for all ufs's inodes. Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21BKL: Remove BKL from ext2 filesystemJan Blunck2-16/+0
The BKL is still used in ext2_put_super(), ext2_fill_super(), ext2_sync_fs() ext2_remount() and ext2_write_inode(). From these calls ext2_put_super(), ext2_fill_super() and ext2_remount() are protected against each other by the struct super_block s_umount rw semaphore. The call in ext2_write_inode() could only protect the modification of the ext2_sb_info through ext2_update_dynamic_rev() against concurrent ext2_sync_fs() or ext2_remount(). ext2_fill_super() and ext2_put_super() can be left out because you need a valid filesystem reference in all three cases, which you do not have when you are one of these functions. If the BKL is only protecting the modification of the ext2_sb_info it can safely be removed since this is protected by the struct ext2_sb_info s_lock. Signed-off-by: Jan Blunck <jblunck@suse.de> Cc: Jan Kara <jack@suse.cz> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21ext2: Add ext2_sb_info s_lock spinlockJan Blunck4-1/+39
Add a spinlock that protects against concurrent modifications of s_mount_state, s_blocks_last, s_overhead_last and the content of the superblock's buffer pointed to by sbi->s_es. The spinlock is now used in ext2_xattr_update_super_block() which was setting the EXT2_FEATURE_COMPAT_EXT_ATTR flag on the superblock without protection before. Likewise the spinlock is used in ext2_show_options() to have a consistent view of the mount options. This is a preparation patch for removing the BKL from ext2 in the next patch. Signed-off-by: Jan Blunck <jblunck@suse.de> Cc: Andi Kleen <andi@firstfloor.org> Cc: Jan Kara <jack@suse.cz> Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21ext2: Move ext2_write_super() out of ext2_setup_super()Jan Blunck1-3/+5
Move ext2_write_super() out of ext2_setup_super() as a preparation for the next patch that adds a new lock for superblock fields. Signed-off-by: Jan Blunck <jblunck@suse.de> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21ext2: Fold ext2_commit_super() into ext2_sync_super()Jan Blunck1-19/+9
Both function originally did similar things except that ext2_sync_super() is returning after the call to sync_dirty_buffer(sbh). Therefore this patch adds a wait flag to tell ext2_sync_super() if it has to call sync_dirty_buffer() to wait for in-progress I/O to finish. Signed-off-by: Jan Blunck <jblunck@suse.de> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21ext2: Remove duplicate code from ext2_sync_fs()Jan Blunck1-7/+0
Depending in the state (valid or unchecked) of the filesystem either ext2_sync_super() or ext2_commit_super() is called. If the filesystem is currently valid (it is checked), we first mark it unchecked and afterwards duplicate the work that ext2_sync_super() is doing later. Therefore this patch removes the duplicate code and calls ext2_sync_super() directly after marking the filesystem unchecked. Signed-off-by: Jan Blunck <jblunck@suse.de> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21ext2: Set the write time in ext2_sync_fs()Jan Blunck1-1/+1
This is probably a typo since the write time should actually be updated by ext2_sync_fs() instead of the mount time. Signed-off-by: Jan Blunck <jblunck@suse.de> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21ext2: Use ext2_clear_super_error() in ext2_sync_fs()Jan Blunck1-17/+3
ext2_sync_fs() used to duplicate the code from ext2_clear_super_error(). Signed-off-by: Jan Blunck <jblunck@suse.de> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21ext3: init statistics after journal recovery v2Dmitry Monakhov1-23/+21
Currently block/inode/dir counters are initialized before journal was recovered. In fact after journal recovery this info will probably change which results in incorrect numbers returned from statfs(2). BUG:#15768 Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21ext2: remove useless call to brelse() in ext2_free_inode()Francis Moreau1-5/+4
This patch removes a useless call to brelse(bitmap_bh) since at that point bitmap_bh is NULL and slightly cleans up bitmap_bh handling. Signed-off-by: Francis Moreau <francis.moro@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21quota: optimize mark_dirty logicDmitry Monakhov1-2/+11
- Skip locking if quota is dirty already. - Return old quota state to help fs-specciffic implementation to optimize case where quota was dirty already. Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21ext2: Avoid loading bitmaps for full groups during block allocationJan Kara1-0/+6
There is no point in loading bitmap for groups which are completely full. This causes noticeable performance problems (and memory pressure) on small systems with large full filesystem (http://marc.info/?l=linux-ext4&m=126843108314310&w=2). Port of the same ext3 patch. Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21ext3: Avoid loading bitmaps for full groups during block allocationFrans van de Wiel1-0/+6
There is no point in loading bitmap for groups which are completely full. This causes noticeable performance problems (and memory pressure) on small systems with large full filesystem (http://marc.info/?l=linux-ext4&m=126843108314310&w=2). Jan Kara: Added a comment and changed check to use cpu-endian value. Signed-off-by: "Frans van de Wiel" <fvdw@fvdw.eu> Signed-off-by: Jan Kara <jack@suse.cz>
2010-05-21Fix networking tree iscsi_tcp.c mis-mergeLinus Torvalds1-1/+1
The removal of the 'waitqueue_active()' test in commit d7d05548a6 ("[SCSI] iscsi_tcp: fix relogin/shutdown hang") got incorrectly resolved by David when he back-merged the main git tree into the networking tree in commit 278554bd65 ("Merge branch 'master' of master.kernel.org:..."). There was a content conflict due to 'sock->sk->sk_sleep' being changed into 'sk_sleep(sock->sk)' in the networking tree, but David didn't pick up the iscsi change from the main tree. Reported-by: James Bottomley <James.Bottomley@suse.de> Cc: David Miller <davem@davemloft.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-05-20sound: fixup for usb_buffer_alloc/free renameStephen Rothwell1-5/+5
This is needed before the USB merge. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-05-20USB: remove unused usb_buffer_alloc and usb_buffer_free macrosGreg Kroah-Hartman1-12/+0
Now that all callers are converted over, remove the compatibility functions and all is good. Cc: Daniel Mack <daniel@caiaq.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20usb: musb: update gfp/slab.h includesTejun Heo1-1/+0
Implicit slab.h inclusion via percpu.h is about to go away. Make sure gfp.h or slab.h is included as necessary. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: ftdi_sio: fix legacy SIO-device headerJohan Hovold1-1/+1
Length field of header was incorrectly set to available payload space rather than the actual payload size. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: kl5usb105: reimplement using generic frameworkJohan Hovold1-333/+47
Kill custom read and write implementations (static per-port, singleton(!) urb pool). Also remove changelog header (can be retrieved through git). Read processing and write-buffer handling tested using a cp210x device in a loopback setup. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: kl5usb105: minor clean upsJohan Hovold1-46/+33
Whitespace changes and some removed comments. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: kl5usb105: fix memory leakJohan Hovold1-0/+1
Private data was not freed on error path in startup. Cc: stable <stable@kernel.org> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: io_ti: use kfifo to implement write bufferingJohan Hovold1-210/+13
Kill custom fifo implementation. Compile-only tested. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: io_ti: remove unsused private counterJohan Hovold1-5/+0
Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: ti_usb: use kfifo to implement write bufferingJohan Hovold1-165/+14
Kill custom fifo implementation. Compile-only tested. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: ir-usb: fix incorrect write-buffer lengthJohan Hovold1-1/+3
Returned length should include header length. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: aircable: fix incorrect write-buffer lengthJohan Hovold1-1/+1
Returned length should include header length. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: safe_serial: straighten out read processingJohan Hovold1-22/+21
Clean up read processing logic. Tested using a cp210x device in a loopback setup. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: safe_serial: reimplement read using generic frameworkJohan Hovold1-39/+8
Use process_read_urb to implement read processing. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: safe_serial: reimplement write using generic frameworkJohan Hovold1-111/+32
Kill custom single-urb write implementation. Note that this driver still depended on the write callback from the old generic framework. Tested against original read processing using a cp210x device in a loopback setup. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20usb-storage: always print quirksFelipe Contreras1-3/+6
Right now quirks are printed only when the are manually overriden with the module parameters. It's not so useful to remind the user that his parameters are correctly applied; what is useful is to print out the quirks the user is not aware are being applied. So let's do the smart thing and print the quirks when they are present. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: usb-storage: trivial debug improvementsFelipe Contreras1-29/+32
Use pr_foo and dev_foo instead of printk. Maybe US_DEBUG* should be replaced too. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: oti6858: use port write fifoJohan Hovold1-37/+25
Kill private write fifo and use port fifo instead (protected under port lock). Compile-only tested. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: oti6858: use kfifo to implement write bufferingJohan Hovold1-201/+17
Kill custom fifo implementation. Use private write fifo to minimise changes to lock handling. Compile-only tested. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>