#
ab73ef46 |
| 03-Mar-2016 |
Nikolay Borisov <kernel@kyup.com> |
quota: Fix possible GPF due to uninitialised pointers
When dqget() in __dquot_initialize() fails e.g. due to IO error, __dquot_initialize() will pass an array of uninitialized pointers to dqput_all(
quota: Fix possible GPF due to uninitialised pointers
When dqget() in __dquot_initialize() fails e.g. due to IO error, __dquot_initialize() will pass an array of uninitialized pointers to dqput_all() and thus can lead to deference of random data. Fix the problem by properly initializing the array.
CC: stable@vger.kernel.org Signed-off-by: Nikolay Borisov <kernel@kyup.com> Signed-off-by: Jan Kara <jack@suse.cz>
show more ...
|
#
044c9b67 |
| 18-Feb-2016 |
Jan Kara <jack@suse.cz> |
quota: Fix possible races during quota loading
When loading new quota structure from disk, there is a possibility caller of dqget() will see uninitialized data due to CPU reordering loads or stores
quota: Fix possible races during quota loading
When loading new quota structure from disk, there is a possibility caller of dqget() will see uninitialized data due to CPU reordering loads or stores - loads from dquot can be reordered before test of DQ_ACTIVE_B bit or setting of this bit could be reordered before filling of the structure. Fix the issue by adding proper memory barriers.
Signed-off-by: Jan Kara <jack@suse.cz>
show more ...
|
#
be6257b2 |
| 25-Jan-2016 |
Jan Kara <jack@suse.cz> |
quota: Add support for ->get_nextdqblk() for VFS quota
Add infrastructure for supporting get_nextdqblk() callback for VFS quotas. Translate the operation into a callback to appropriate filesystem an
quota: Add support for ->get_nextdqblk() for VFS quota
Add infrastructure for supporting get_nextdqblk() callback for VFS quotas. Translate the operation into a callback to appropriate filesystem and consequently to quota format callback.
Signed-off-by: Jan Kara <jack@suse.cz>
show more ...
|
#
5955102c |
| 22-Jan-2016 |
Al Viro <viro@zeniv.linux.org.uk> |
wrappers for ->i_mutex access
parallel to mutex_{lock,unlock,trylock,is_locked,lock_nested}, inode_foo(inode) being mutex_foo(&inode->i_mutex).
Please, use those for access to ->i_mutex; over the c
wrappers for ->i_mutex access
parallel to mutex_{lock,unlock,trylock,is_locked,lock_nested}, inode_foo(inode) being mutex_foo(&inode->i_mutex).
Please, use those for access to ->i_mutex; over the coming cycle ->i_mutex will become rwsem, with ->lookup() done with it held only shared.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
show more ...
|
#
331221fa |
| 12-Dec-2015 |
Paul Gortmaker <paul.gortmaker@windriver.com> |
fs: make quota/dquot.c explicitly non-modular
The Kconfig currently controlling compilation of this code is:
config QUOTA bool "Quota support"
...meaning that it currently is not being bui
fs: make quota/dquot.c explicitly non-modular
The Kconfig currently controlling compilation of this code is:
config QUOTA bool "Quota support"
...meaning that it currently is not being built as a module by anyone.
Lets remove the couple traces of modularity so that when reading the driver there is no doubt it is builtin-only.
Since module_init translates to device_initcall in the non-modular case, the init ordering gets bumped to one level earlier when we use the more appropriate fs_initcall here. However we've made similar changes before without any fallout and none is expected here either.
We don't delete module.h because the code in turn tries to load other modules as appropriate and so it still needs that header.
Cc: Jan Kara <jack@suse.com> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Jan Kara <jack@suse.cz>
show more ...
|
#
74278da9 |
| 04-Mar-2015 |
Dave Chinner <dchinner@redhat.com> |
inode: convert inode_sb_list_lock to per-sb
The process of reducing contention on per-superblock inode lists starts with moving the locking to match the per-superblock inode list. This takes the glo
inode: convert inode_sb_list_lock to per-sb
The process of reducing contention on per-superblock inode lists starts with moving the locking to match the per-superblock inode list. This takes the global lock out of the picture and reduces the contention problems to within a single filesystem. This doesn't get rid of contention as the locks still have global CPU scope, but it does isolate operations on different superblocks form each other.
Signed-off-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Josef Bacik <jbacik@fb.com> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Christoph Hellwig <hch@lst.de> Tested-by: Dave Chinner <dchinner@redhat.com>
show more ...
|
#
6184fc0b |
| 24-Jun-2015 |
Jan Kara <jack@suse.cz> |
quota: Propagate error from ->acquire_dquot()
Currently when some error happened in ->acquire_dquot(), dqget() just returned NULL. That was indistinguishable from a case when e.g. someone run quotao
quota: Propagate error from ->acquire_dquot()
Currently when some error happened in ->acquire_dquot(), dqget() just returned NULL. That was indistinguishable from a case when e.g. someone run quotaoff and so was generally silently ignored. However ->acquire_dquot() can fail because of ENOSPC or EIO in which case user should better know. So propagate error up from ->acquire_dquot properly.
Signed-off-by: Jan Kara <jack@suse.cz>
show more ...
|
#
dea655c2 |
| 17-Mar-2015 |
David Howells <dhowells@redhat.com> |
VFS: fs library helpers: d_inode() annotations
library helpers called by filesystem drivers on their own inodes
Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv
VFS: fs library helpers: d_inode() annotations
library helpers called by filesystem drivers on their own inodes
Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
show more ...
|
#
847aac64 |
| 18-Mar-2015 |
Li Xi <pkuelelixi@gmail.com> |
vfs: Add general support to enforce project quota limits
This patch adds support for a new quota type PRJQUOTA for project quota enforcement. Also a new method get_projid() is added into dquot_opera
vfs: Add general support to enforce project quota limits
This patch adds support for a new quota type PRJQUOTA for project quota enforcement. Also a new method get_projid() is added into dquot_operations structure.
Signed-off-by: Li Xi <lixi@ddn.com> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Jan Kara <jack@suse.cz>
show more ...
|
#
5bcd3b6f |
| 12-Feb-2015 |
Konstantin Khlebnikov <khlebnikov@yandex-team.ru> |
quota: optimize i_dquot access
Remove redundant calls of i_dquot(), keep pointer in local variable.
add/remove: 0/0 grow/shrink: 3/7 up/down: 40/-278 (-238) function
quota: optimize i_dquot access
Remove redundant calls of i_dquot(), keep pointer in local variable.
add/remove: 0/0 grow/shrink: 3/7 up/down: 40/-278 (-238) function old new delta __dquot_free_space 734 750 +16 __dquot_alloc_space 484 500 +16 dquot_free_inode 324 332 +8 dquot_drop 82 69 -13 vfs_load_quota_inode 1357 1341 -16 dquot_reclaim_space_nodirty 348 316 -32 dquot_disable 1980 1944 -36 dquot_claim_space_nodirty 354 314 -40 __dquot_drop 125 83 -42 __dquot_initialize 522 423 -99
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Signed-off-by: Jan Kara <jack@suse.cz>
show more ...
|
#
5eacb2ac |
| 16-Dec-2014 |
Jan Kara <jack@suse.cz> |
quota: Make ->set_info use structure with neccesary info to VFS and XFS
Change ->set_info to take new qc_info structure which contains all the necessary information both for XFS and VFS. Convert Q_S
quota: Make ->set_info use structure with neccesary info to VFS and XFS
Change ->set_info to take new qc_info structure which contains all the necessary information both for XFS and VFS. Convert Q_SETINFO handler to use this structure.
Signed-off-by: Jan Kara <jack@suse.cz>
show more ...
|
#
0a240339 |
| 18-Nov-2014 |
Jan Kara <jack@suse.cz> |
quota: Make VFS quotas use new interface for getting quota info
Create new internal interface for getting information about quota which contains everything needed for both VFS quotas and XFS quotas.
quota: Make VFS quotas use new interface for getting quota info
Create new internal interface for getting information about quota which contains everything needed for both VFS quotas and XFS quotas. Make VFS use this and hook it up to Q_GETINFO.
Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
show more ...
|
#
b10a0819 |
| 09-Oct-2014 |
Jan Kara <jack@suse.cz> |
quota: Store maximum space limit in bytes
Currently maximum space limit quota format supports is in blocks however since we store space limits in bytes, this is somewhat confusing. So store the maxi
quota: Store maximum space limit in bytes
Currently maximum space limit quota format supports is in blocks however since we store space limits in bytes, this is somewhat confusing. So store the maximum limit in bytes as well. Also rename the field to match the new unit and related inode field to match the new naming scheme.
Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
show more ...
|
#
3e2af67e |
| 06-Oct-2014 |
Jan Kara <jack@suse.cz> |
quota: Add ->quota_{enable,disable} callbacks for VFS quotas
Add functions which translate ->quota_enable / ->quota_disable calls into appropriate changes in VFS quota. This will enable filesystems
quota: Add ->quota_{enable,disable} callbacks for VFS quotas
Add functions which translate ->quota_enable / ->quota_disable calls into appropriate changes in VFS quota. This will enable filesystems supporting VFS quota files in system inodes to be controlled via Q_XQUOTA[ON|OFF] quotactls for better userspace compatibility.
Also provide a vector for quotactl using these functions which can be used by filesystems with quota files stored in hidden system files.
Signed-off-by: Jan Kara <jack@suse.cz>
show more ...
|
#
14bf61ff |
| 09-Oct-2014 |
Jan Kara <jack@suse.cz> |
quota: Switch ->get_dqblk() and ->set_dqblk() to use bytes as space units
Currently ->get_dqblk() and ->set_dqblk() use struct fs_disk_quota which tracks space limits and usage in 512-byte blocks. H
quota: Switch ->get_dqblk() and ->set_dqblk() to use bytes as space units
Currently ->get_dqblk() and ->set_dqblk() use struct fs_disk_quota which tracks space limits and usage in 512-byte blocks. However VFS quotas track usage in bytes (as some filesystems require that) and we need to somehow pass this information. Upto now it wasn't a problem because we didn't do any unit conversion (thus VFS quota routines happily stuck number of bytes into d_bcount field of struct fd_disk_quota). Only if you tried to use Q_XGETQUOTA or Q_XSETQLIM for VFS quotas (or Q_GETQUOTA / Q_SETQUOTA for XFS quotas), you got bogus results. Hardly anyone tried this but reportedly some Samba users hit the problem in practice. So when we want interfaces compatible we need to fix this.
We bite the bullet and define another quota structure used for passing information from/to ->get_dqblk()/->set_dqblk. It's somewhat sad we have to have more conversion routines in fs/quota/quota.c and another copying of quota structure slows down getting of quota information by about 2% but it seems cleaner than overloading e.g. units of d_bcount to bytes.
CC: stable@vger.kernel.org Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
show more ...
|
#
ca6cb091 |
| 19-Nov-2014 |
Jan Kara <jack@suse.cz> |
quota: Verify flags passed to Q_SETINFO
Currently flags passed via Q_SETINFO were just stored. This makes it hard to add new flags since in theory userspace could be just setting / clearing random f
quota: Verify flags passed to Q_SETINFO
Currently flags passed via Q_SETINFO were just stored. This makes it hard to add new flags since in theory userspace could be just setting / clearing random flags. Since currently there is only one userspace settable flag and that is somewhat obscure flags only for ancient v1 quota format, I'm reasonably sure noone operates these flags and hopefully we are fine just adding the check that passed flags are sane. If we indeed find some userspace program that gets broken by the strict check, we can always remove it again.
Signed-off-by: Jan Kara <jack@suse.cz>
show more ...
|
#
9c45101e |
| 19-Nov-2014 |
Jan Kara <jack@suse.cz> |
quota: Cleanup flags definitions
Currently all quota flags were defined just in kernel-private headers. Export flags readable / writeable from userspace to userspace via include/uapi/linux/quota.h.
quota: Cleanup flags definitions
Currently all quota flags were defined just in kernel-private headers. Export flags readable / writeable from userspace to userspace via include/uapi/linux/quota.h.
Signed-off-by: Jan Kara <jack@suse.cz>
show more ...
|
#
75cbe701 |
| 29-Sep-2014 |
Jan Kara <jack@suse.cz> |
vfs: Remove i_dquot field from inode
All filesystems using VFS quotas are now converted to use their private i_dquot fields. Remove the i_dquot field from generic inode structure.
Acked-by: Christo
vfs: Remove i_dquot field from inode
All filesystems using VFS quotas are now converted to use their private i_dquot fields. Remove the i_dquot field from generic inode structure.
Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
show more ...
|
#
2d0fa467 |
| 25-Sep-2014 |
Jan Kara <jack@suse.cz> |
quota: Use function to provide i_dquot pointers
i_dquot array is used by relatively few filesystems (ext?, ocfs2, jfs, reiserfs) so it is beneficial to move this array to fs-private part of the inod
quota: Use function to provide i_dquot pointers
i_dquot array is used by relatively few filesystems (ext?, ocfs2, jfs, reiserfs) so it is beneficial to move this array to fs-private part of the inode. We cannot just pass quota pointers from filesystems to quota functions because during quotaon and quotaoff we have to traverse list of all inodes and manipulate i_dquot pointers for each inode. So we provide a function which generic quota code can use to get pointer to the i_dquot array from the filesystem.
Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
show more ...
|
#
6bab3596 |
| 20-Oct-2014 |
Jan Kara <jack@suse.cz> |
quota: Remove const from function declarations
We don't use const through VFS too much so just remove it from quota function declarations.
Signed-off-by: Jan Kara <jack@suse.cz>
|
#
19858e7b |
| 03-Nov-2014 |
Anton Blanchard <anton@samba.org> |
quota: Add log level to printk
JK: Added VFS: prefix to the message when changing it to make it more standard.
Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Jan Kara <jack@sus
quota: Add log level to printk
JK: Added VFS: prefix to the message when changing it to make it more standard.
Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Jan Kara <jack@suse.cz>
show more ...
|
#
474d2605 |
| 22-Oct-2014 |
Jan Kara <jack@suse.cz> |
quota: Properly return errors from dquot_writeback_dquots()
Due to a switched left and right side of an assignment, dquot_writeback_dquots() never returned error. This could result in errors during
quota: Properly return errors from dquot_writeback_dquots()
Due to a switched left and right side of an assignment, dquot_writeback_dquots() never returned error. This could result in errors during quota writeback to not be reported to userspace properly. Fix it.
CC: stable@vger.kernel.org Coverity-id: 1226884 Signed-off-by: Jan Kara <jack@suse.cz>
show more ...
|
#
908c7f19 |
| 07-Sep-2014 |
Tejun Heo <tj@kernel.org> |
percpu_counter: add @gfp to percpu_counter_init()
Percpu allocator now supports allocation mask. Add @gfp to percpu_counter_init() so that !GFP_KERNEL allocation masks can be used with percpu_count
percpu_counter: add @gfp to percpu_counter_init()
Percpu allocator now supports allocation mask. Add @gfp to percpu_counter_init() so that !GFP_KERNEL allocation masks can be used with percpu_counters too.
We could have left percpu_counter_init() alone and added percpu_counter_init_gfp(); however, the number of users isn't that high and introducing _gfp variants to all percpu data structures would be quite ugly, so let's just do the conversion. This is the one with the most users. Other percpu data structures are a lot easier to convert.
This patch doesn't make any functional difference.
Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Jan Kara <jack@suse.cz> Acked-by: "David S. Miller" <davem@davemloft.net> Cc: x86@kernel.org Cc: Jens Axboe <axboe@kernel.dk> Cc: "Theodore Ts'o" <tytso@mit.edu> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: Andrew Morton <akpm@linux-foundation.org>
show more ...
|
#
b9ba6f94 |
| 03-Jun-2014 |
Niu Yawei <yawei.niu@gmail.com> |
quota: remove dqptr_sem
Remove dqptr_sem to make quota code scalable: Remove the dqptr_sem, accessing inode->i_dquot now protected by dquot_srcu, and changing inode->i_dquot is now serialized by dq_
quota: remove dqptr_sem
Remove dqptr_sem to make quota code scalable: Remove the dqptr_sem, accessing inode->i_dquot now protected by dquot_srcu, and changing inode->i_dquot is now serialized by dq_data_lock.
Signed-off-by: Lai Siyao <lai.siyao@intel.com> Signed-off-by: Niu Yawei <yawei.niu@intel.com> Signed-off-by: Jan Kara <jack@suse.cz>
show more ...
|
#
9eb6463f |
| 03-Jun-2014 |
Niu Yawei <yawei.niu@gmail.com> |
quota: simplify remove_inode_dquot_ref()
Simplify the remove_inode_dquot_ref() to make it more obvious that now we keep one reference for each dquot from inodes.
Signed-off-by: Jan Kara <jack@suse.
quota: simplify remove_inode_dquot_ref()
Simplify the remove_inode_dquot_ref() to make it more obvious that now we keep one reference for each dquot from inodes.
Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Niu Yawei <yawei.niu@intel.com> Signed-off-by: Jan Kara <jack@suse.cz>
show more ...
|