Re: [Ocfs2-devel] [PATCH 2/6] ocfs2: Fix quota recovery failure on unmount

2018-03-21 Thread Jan Kara
; > disabling of recovery in ocfs2_dismount_volume() before disabling of quotas > > to fix this race. > > > > Signed-off-by: Jan Kara > > --- > > fs/ocfs2/super.c | 10 +++--- > > 1 file changed, 7 insertions(+), 3 deletions(-) > > > > diff --gi

[Ocfs2-devel] [PATCH 4/6] ocfs2: Move scheduling of dqi_sync_work up in call stack

2018-02-28 Thread Jan Kara
Move scheduling of dqi_sync_work up in the call stack to ocfs2_enable_quotas() and ocfs2_susp_quotas(). This will later allow us to not schedule this work when quotas are enabled on read-only filesystem and also makes scheduling & canceling of dqi_sync_work more symmetric. Signed-off-by: Jan

[Ocfs2-devel] [PATCH 1/6] Linux 4.16-rc3

2018-02-28 Thread Jan Kara
From: Linus Torvalds --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d9cf3a40eda9..659a7780aeb3 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ VERSION = 4 PATCHLEVEL = 16 SUBLEVEL = 0 -EXTRAVERSION = -rc2 +EXTRAVERSION = -rc3 N

[Ocfs2-devel] [PATCH 0/6] ocfs2: Fix various quota recovery

2018-02-28 Thread Jan Kara
Hello, this patch series fixes various issues I've found with ocfs2 quota recovery. There were possible quota recovery failures or deadlocks when it raced with umount in a wrong way. Also quota recovery would fail if the filesystem was mounted read-only. The final patch is an unrelated fix for mou

[Ocfs2-devel] [PATCH 5/6] ocfs2: Fix quota recovery for read-only mounts

2018-02-28 Thread Jan Kara
iodic flushing of our local changes to the global quota file since that is pointless for read-only mounts. Signed-off-by: Jan Kara --- fs/ocfs2/super.c | 99 +--- 1 file changed, 44 insertions(+), 55 deletions(-) diff --git a/fs/ocfs2/super.c b/fs/

[Ocfs2-devel] [PATCH 3/6] ocfs2: Fix deadlock during umount

2018-02-28 Thread Jan Kara
disabling of quotas by the fact that quotas gets disabled only on umount and that happens after recovery is disabled. Reported-by: Shichangkuo Signed-off-by: Jan Kara --- fs/ocfs2/quota_local.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/ocfs2/quota_local.c

[Ocfs2-devel] [PATCH 2/6] ocfs2: Fix quota recovery failure on unmount

2018-02-28 Thread Jan Kara
quotas to fix this race. Signed-off-by: Jan Kara --- fs/ocfs2/super.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index ffa4952d432b..14c3d5ee6e24 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -1904,6 +1904,13

[Ocfs2-devel] [PATCH 6/6] ocfs2: Do not fail remount when mounted without heartbeat option

2018-02-28 Thread Jan Kara
heartbeat=none as shown in /proc/mounts is considered to be a change of hearbeat mode. Fix the problem by defaulting heartbeat mode to 'none' and making sure it gets set when no mount options are specified. Signed-off-by: Jan Kara --- fs/ocfs2/super.c | 14 +- 1 file

Re: [Ocfs2-devel] [Ocfs2-dev] BUG: deadlock with umount and ocfs2 workqueue triggered by ocfs2rec thread

2018-01-19 Thread Jan Kara
ound several other problems / races that also need fixing (e.g. if some node mounts a filesystem in read-only mode and ends up doing recovery of some crashed node, quota recovery will not work). So I plan to do some more fixing in this area, just didn't get to it yet.

Re: [Ocfs2-devel] [Ocfs2-dev] BUG: deadlock with umount and ocfs2 workqueue triggered by ocfs2rec thread

2018-01-17 Thread Jan Kara
On Wed 17-01-18 16:21:35, Jan Kara wrote: > Hello, > > On Fri 12-01-18 16:25:56, Eric Ren wrote: > > On 01/12/2018 11:43 AM, Shichangkuo wrote: > > > Hi all, > > >   Now we are testing ocfs2 with 4.14 kernel, and we finding a deadlock > > > with umount

Re: [Ocfs2-devel] [Ocfs2-dev] BUG: deadlock with umount and ocfs2 workqueue triggered by ocfs2rec thread

2018-01-17 Thread Jan Kara
ta recovery happens from the recovery thread in ocfs2_finish_quota_recovery(). We need to protect code running there from dquot_disable() calls as that will free structures we use for updating quota information etc. Currently we use sb->s_umount for that protection. The problem above apparently happens

[Ocfs2-devel] [PATCH 1/2] ocfs2: Make ocfs2_set_acl() static

2017-08-01 Thread Jan Kara
The function is never called outside of fs/ocfs2/acl.c. CC: Joel Becker CC: ocfs2-devel@oss.oracle.com Signed-off-by: Jan Kara --- fs/ocfs2/acl.c | 2 +- fs/ocfs2/acl.h | 7 --- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c index dc22ba8c710f

[Ocfs2-devel] [PATCH 2/2] ocfs2: Don't clear SGID when inheriting ACLs

2017-08-01 Thread Jan Kara
want as it prevents SGID bit clearing and the mode has been properly set by posix_acl_create() anyway. Also posix_acl_chmod() that is calling ocfs2_set_acl() takes care of updating mode itself. Fixes: 073931017b49d9458aa351605b43a7e34598caef CC: sta...@vger.kernel.org CC: Joel Becker CC: ocfs2-devel@oss.

[Ocfs2-devel] [PATCH 0/2] ocfs2: Fix clearing of SGID when inheriting ACLs

2017-08-01 Thread Jan Kara
Hi Andrew, can you please merge these two patches? The first is a small cleanup, the second fixes actual bug when SGID on directory is wrongly cleared when inheriting ACLs from parent directory (see changelog of the second patch for details). Thanks!

Re: [Ocfs2-devel] [PATCH] fs: convert a pile of fsync routines to errseq_t based reporting

2017-07-31 Thread Jan Kara
is a straightforward conversion from calling > filemap_write_and_wait_range in their fsync operation to calling > file_write_and_wait_range. > > Signed-off-by: Jeff Layton This all looks rather obvious. Feel free to add: Acked-by: Jan Kara

[Ocfs2-devel] [PATCH 2/2] ocfs2: Don't clear SGID when inheriting ACLs

2017-07-18 Thread Jan Kara
want as it prevents SGID bit clearing and the mode has been properly set by posix_acl_create() anyway. Also posix_acl_chmod() that is calling ocfs2_set_acl() takes care of updating mode itself. Fixes: 073931017b49d9458aa351605b43a7e34598caef CC: sta...@vger.kernel.org CC: Joel Becker CC: ocfs2-devel@oss.

[Ocfs2-devel] [PATCH 1/2] ocfs2: Make ocfs2_set_acl() static

2017-07-18 Thread Jan Kara
The function is never called outside of fs/ocfs2/acl.c. CC: Joel Becker CC: ocfs2-devel@oss.oracle.com Signed-off-by: Jan Kara --- fs/ocfs2/acl.c | 2 +- fs/ocfs2/acl.h | 7 --- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c index dc22ba8c710f

[Ocfs2-devel] [PATCH 0/11 v1] Fix inheritance of SGID in presence of default ACLs

2017-06-22 Thread Jan Kara
Hello, this patch set fixes a problem introduced by commit 073931017b49 "posix_acl: Clear SGID bit when setting file permissions". The problem is that when new directory 'DIR1' is created in a directory 'DIR0' with SGID bit set, DIR1 is expected to have SGID bit set (and owning group equal to the

[Ocfs2-devel] [PATCH 07/11] ocfs2: Make ocfs2_set_acl() static

2017-06-22 Thread Jan Kara
The function is never called outside of fs/ocfs2/acl.c. CC: Joel Becker CC: ocfs2-devel@oss.oracle.com Signed-off-by: Jan Kara --- fs/ocfs2/acl.c | 2 +- fs/ocfs2/acl.h | 7 --- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c index dc22ba8c710f

[Ocfs2-devel] [PATCH 08/11] ocfs2: Don't clear SGID when inheriting ACLs

2017-06-22 Thread Jan Kara
want as it prevents SGID bit clearing and the mode has been properly set by posix_acl_create() anyway. Also posix_acl_chmod() that is calling ocfs2_set_acl() takes care of updating mode itself. Fixes: 073931017b49d9458aa351605b43a7e34598caef CC: sta...@vger.kernel.org CC: Joel Becker CC: ocfs2-devel@oss.

Re: [Ocfs2-devel] [PATCH 28/28] quota: add extra inode count to dquot transfer functions

2017-06-19 Thread Jan Kara
ough can try to handle the error. That way we at least don't increase the design debt from the past. Honza -- Jan Kara SUSE Labs, CR ___ Ocfs2-devel mailing list Ocfs2-devel@oss.oracle.com https://oss.oracle.com/mailman/listinfo/ocfs2-devel

Re: [Ocfs2-devel] [PATCH 28/28] quota: add extra inode count to dquot transfer functions

2017-06-19 Thread Jan Kara
On Fri 16-06-17 18:50:58, Tahsin Erdogan wrote: > On Thu, Jun 15, 2017 at 12:57 AM, Jan Kara wrote: > > Hum, rather handle this similarly to how we handle delalloc reserved space. > > Add a callback to dq_ops to get "inode usage" of an inode and then use

Re: [Ocfs2-devel] [PATCH 23/28] mbcache: make mbcache more generic

2017-06-19 Thread Jan Kara
On Thu 15-06-17 11:25:02, Tahsin Erdogan wrote: > On Thu, Jun 15, 2017 at 12:41 AM, Jan Kara wrote: > > Can you explain a bit more what do you mean by "make it more generic" as it > > seems you just rename a couple of things here... > > The change is really just t

Re: [Ocfs2-devel] [PATCH 30/31] ext4: eliminate xattr entry e_hash recalculation for removes

2017-06-19 Thread Jan Kara
On Fri 16-06-17 19:04:44, Tahsin Erdogan wrote: > On Thu, Jun 15, 2017 at 2:10 AM, Jan Kara wrote: > > I agree with moving ext4_xattr_rehash_entry() out of ext4_xattr_rehash(). > > However how about just keeping ext4_xattr_rehash() in > > ext4_xattr_block_set() (so that y

Re: [Ocfs2-devel] [PATCH 30/31] ext4: eliminate xattr entry e_hash recalculation for removes

2017-06-15 Thread Jan Kara
= (__le32 *)((char *)header + > + __le32 *value = (__le32 *)((char *)value_base + > le16_to_cpu(entry->e_value_offs)); > for (n = (le32_to_cpu(entry->e_value_size) + >EXT4_XATTR_ROUND) >> EXT4_XATTR_PAD_

Re: [Ocfs2-devel] [PATCH 28/28] quota: add extra inode count to dquot transfer functions

2017-06-15 Thread Jan Kara
eiserfs_write_unlock(inode->i_sb); > if (error) > goto out; > - error = dquot_transfer(inode, attr); > + error = dquot_transfer(inode, attr, 0); > reiserfs_write_lock(inode->i_sb); >

Re: [Ocfs2-devel] [PATCH 23/28] mbcache: make mbcache more generic

2017-06-15 Thread Jan Kara
ntry */ > + cache_value_t e_value; > }; > > struct mb_cache *mb_cache_create(int bucket_bits); > void mb_cache_destroy(struct mb_cache *cache); > > int mb_cache_entry_create(struct mb_cache *cache, gfp_t mask, u32 key, > -

[Ocfs2-devel] [PATCH 6/7] ocfs2: Use s_umount for quota recovery protection

2016-11-24 Thread Jan Kara
Currently we use dqonoff_mutex to serialize quota recovery protection and turning of quotas on / off. Use s_umount semaphore instead. Signed-off-by: Jan Kara --- fs/ocfs2/quota_local.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fs/ocfs2/quota_local.c b/fs

[Ocfs2-devel] [PATCH 3/7] quota: Use s_umount protection for quota operations

2016-11-24 Thread Jan Kara
check whether filesystem freezing is not in progress but still it is good to have this fixed. Reported-by: Ted Tso Reported-by: Eric Whitney Signed-off-by: Jan Kara --- fs/quota/dquot.c | 39 ++- fs/quota/quota.c | 6 +- 2 files changed, 11 insertions

[Ocfs2-devel] [PATCH 5/7] quota: Remove dqonoff_mutex from dquot_scan_active()

2016-11-24 Thread Jan Kara
All callers of dquot_scan_active() now hold s_umount so we can rely on that lock to protect us against quota state changes. Signed-off-by: Jan Kara --- fs/quota/dquot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 2a9dc3fb491c

[Ocfs2-devel] [PATCH 4/7] ocfs2: Protect periodic quota syncing with s_umount semaphore

2016-11-24 Thread Jan Kara
New quota locking rules will require s_umount semaphore for all quota scanning functions. Add is for periodic quota syncing. Signed-off-by: Jan Kara --- fs/ocfs2/quota_global.c | 10 +- fs/ocfs2/super.c| 1 - 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/fs

[Ocfs2-devel] [PATCH 1/7] fs: Provide function to get superblock with exclusive s_umount

2016-11-24 Thread Jan Kara
Quota code will need a variant of get_super_thawed() that returns superblock with s_umount held in exclusive mode to serialize quota on and quota off operations. Provide this functionality. Signed-off-by: Jan Kara --- fs/super.c | 80

[Ocfs2-devel] [PATCH 7/7] quota: Remove dqonoff_mutex

2016-11-24 Thread Jan Kara
The only places that were grabbing dqonoff_mutex are functions turning quotas on and off and these are properly serialized using s_umount semaphore. Remove dqonoff_mutex. Signed-off-by: Jan Kara --- fs/quota/dquot.c | 78 +++ fs/super.c

[Ocfs2-devel] [PATCH 0/7] quota: Use s_umount for quota on/off serialization

2016-11-24 Thread Jan Kara
Hello, this patch set changes quota code to use s_umount semaphore for serialization of quota on/off operations among each other and with other quotactl and quota writeback operations. So far we have used dedicated dqonoff_mutex but that triggered lockdep warnings during fs freezing and also unnec

[Ocfs2-devel] [PATCH 2/7] quota: Hold s_umount in exclusive mode when enabling / disabling quotas

2016-11-24 Thread Jan Kara
. Signed-off-by: Jan Kara --- fs/quota/dquot.c | 11 +++ fs/quota/quota.c | 15 +-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 1bfac28b7e7d..047afb966420 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -2107,6

[Ocfs2-devel] [PATCH 3/6] ext4: Use clean_bdev_aliases() instead of iteration

2016-11-04 Thread Jan Kara
Use clean_bdev_aliases() instead of iterating through blocks one by one. Signed-off-by: Jan Kara --- fs/ext4/extents.c | 13 ++--- fs/ext4/inode.c | 15 --- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index

[Ocfs2-devel] [PATCH 4/6] ext2: Use clean_bdev_aliases() instead of iteration

2016-11-04 Thread Jan Kara
Use clean_bdev_aliases() instead of iterating through blocks one by one. Signed-off-by: Jan Kara --- fs/ext2/inode.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index d831e24dc885..eb11f7e2b8aa 100644 --- a/fs/ext2/inode.c +++ b

[Ocfs2-devel] [PATCH 0/6 v2] fs: Provide function to unmap metadata for a range of blocks

2016-11-04 Thread Jan Kara
Hello, I've noticed that in several places we need to unmap metadata in buffer cache for a range of blocks and we do it by iterating over all blocks in given range. Let's provide a helper function for that and implement it in a way more efficient for larger ranges of blocks. Also cleanup other use

[Ocfs2-devel] [PATCH 5/6] fs: Add helper to clean bdev aliases under a bh and use it

2016-11-04 Thread Jan Kara
for a *long* time. Signed-off-by: Jan Kara --- fs/buffer.c | 8 +++- fs/ext4/inode.c | 3 +-- fs/ext4/page-io.c | 2 +- fs/mpage.c | 3 +-- fs/ntfs/aops.c | 2 +- fs/ntfs/file.c | 5 ++--- fs/ocfs2/aops.c

[Ocfs2-devel] [PATCH 1/6] fs: Provide function to unmap metadata for a range of blocks

2016-11-04 Thread Jan Kara
ff-by: Jan Kara --- fs/buffer.c | 76 + include/linux/buffer_head.h | 2 ++ 2 files changed, 78 insertions(+) diff --git a/fs/buffer.c b/fs/buffer.c index b205a629001d..05f30838cec3 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -43,6

[Ocfs2-devel] [PATCH 2/6] direct-io: Use clean_bdev_aliases() instead of handmade iteration

2016-11-04 Thread Jan Kara
Use new provided function instead of an iteration through all allocated blocks. Signed-off-by: Jan Kara --- fs/direct-io.c | 28 +++- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/fs/direct-io.c b/fs/direct-io.c index fb9aa16a7727..12ac532a444a 100644

[Ocfs2-devel] [PATCH 6/6] fs: Remove unmap_underlying_metadata

2016-11-04 Thread Jan Kara
Nobody is using this function anymore. Remove it. Signed-off-by: Jan Kara --- fs/buffer.c | 32 include/linux/buffer_head.h | 1 - 2 files changed, 33 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index f96c079e181d..6d6680c8d306 100644

Re: [Ocfs2-devel] [PATCH] quota: use time64_t internally

2016-06-19 Thread Jan Kara
> end up doing the right thing everywhere for v2 format. > > Signed-off-by: Arnd Bergmann Thanks. I've added the patch to my tree and will push it to Linus in the next merge window.

Re: [Ocfs2-devel] [PATCH 1/2] quota: Handle Q_GETNEXTQUOTA when quota is disabled

2016-04-04 Thread Jan Kara
On Fri 01-04-16 10:39:56, Ted Tso wrote: > On Tue, Mar 29, 2016 at 06:11:43PM +0200, Jan Kara wrote: > > Currently we oopsed when Q_GETNEXTQUOTA got called when quota was > > disabled. Properly check whether quota is enabled for the filesystem > > before calling into

[Ocfs2-devel] [PATCH 1/2] quota: Handle Q_GETNEXTQUOTA when quota is disabled

2016-03-29 Thread Jan Kara
Currently we oopsed when Q_GETNEXTQUOTA got called when quota was disabled. Properly check whether quota is enabled for the filesystem before calling into quota format handler. Reported-by: Ted Tso Signed-off-by: Jan Kara --- fs/quota/dquot.c | 13 +++-- 1 file changed, 11 insertions

[Ocfs2-devel] [PATCH 2/2] ocfs2: Fix Q_GETNEXTQUOTA for filesystem without quotas

2016-03-29 Thread Jan Kara
When Q_GETNEXTQUOTA was called for filesystem with quotas disabled ocfs2_get_next_id() oopses. Fix the problem by checking early whether the filesystem has quotas enabled. Signed-off-by: Jan Kara --- fs/ocfs2/quota_global.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff

[Ocfs2-devel] [PATCH] ocfs2: Fix return value from ocfs2_page_mkwrite()

2016-03-03 Thread Jan Kara
ocfs2_page_mkwrite() could mistakenly return error code instead of mkwrite status value. Fix it. Signed-off-by: Jan Kara --- fs/ocfs2/mmap.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/ocfs2/mmap.c b/fs/ocfs2/mmap.c index 9581d190f6e1..77ebc2bc1cca 100644 --- a/fs/ocfs2/mmap.c

Re: [Ocfs2-devel] [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota

2016-02-22 Thread Jan Kara
On Fri 19-02-16 12:43:13, Eric Sandeen wrote: > > > On 2/19/16 12:33 PM, Jan Kara wrote: > > On Fri 19-02-16 11:31:58, Eric Sandeen wrote: > >> > >> > >> On 2/4/16 8:28 AM, Jan Kara wrote: > >>> Add infrastructure for supporting get_ne

Re: [Ocfs2-devel] [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota

2016-02-19 Thread Jan Kara
On Fri 19-02-16 11:31:58, Eric Sandeen wrote: > > > On 2/4/16 8:28 AM, Jan Kara wrote: > > Add infrastructure for supporting get_nextdqblk() callback for VFS > > quotas. Translate the operation into a callback to appropriate > > filesystem and consequent

Re: [Ocfs2-devel] [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota

2016-02-08 Thread Jan Kara
On Mon 08-02-16 15:27:49, Jan Kara wrote: > On Fri 05-02-16 12:05:19, Dave Chinner wrote: > > On Thu, Feb 04, 2016 at 03:28:05PM +0100, Jan Kara wrote: > > > Add infrastructure for supporting get_nextdqblk() callback for VFS > > > quotas. Translate the operation int

Re: [Ocfs2-devel] [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota

2016-02-08 Thread Jan Kara
On Fri 05-02-16 12:05:19, Dave Chinner wrote: > On Thu, Feb 04, 2016 at 03:28:05PM +0100, Jan Kara wrote: > > Add infrastructure for supporting get_nextdqblk() callback for VFS > > quotas. Translate the operation into a callback to appropriate > > filesystem and consequ

[Ocfs2-devel] [PATCH 3/3] ocfs2: Implement get_next_id()

2016-02-04 Thread Jan Kara
Implement get_next_id() callback to enable use of Q_GETNEXTQUOTA quotactl for OCFS2. Signed-off-by: Jan Kara --- fs/ocfs2/ocfs2_trace.h | 2 ++ fs/ocfs2/quota_global.c | 25 + 2 files changed, 27 insertions(+) diff --git a/fs/ocfs2/ocfs2_trace.h b/fs/ocfs2

[Ocfs2-devel] [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota

2016-02-04 Thread Jan Kara
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 --- fs/ext4/super.c | 1 + fs/quota/dquot.c | 39

[Ocfs2-devel] [PATCH 2/3] quota_v2: Implement get_next_id() for V2 quota format

2016-02-04 Thread Jan Kara
Implement functions to get id of next existing quota structure in quota file for quota tree based formats and thus for V2 quota format. Signed-off-by: Jan Kara --- fs/quota/quota_tree.c | 67 +++-- fs/quota/quota_v2.c | 6 include

[Ocfs2-devel] [PATCH 0/3 v2] Q_GETNEXTQUOTA support

2016-02-04 Thread Jan Kara
Hello, the patch set below adds support for VFS quotas for Q_GETNEXTQUOTA quotactl and thus repquota(8) doesn't have to iterate over /etc/passwd or LDAP database to report all quota limits. ext2, ext4, reiserfs, jfs, and ocfs2 support this quotactl (and Q_XGETNEXTQUOTA as well) after applying this

Re: [Ocfs2-devel] [PATCH v8] fs: clear file privilege bits when mmap writing

2016-01-15 Thread Jan Kara
On Thu 14-01-16 10:35:17, Konstantin Khlebnikov wrote: > On Wed, Jan 13, 2016 at 11:33 PM, Kees Cook wrote: > > On Wed, Jan 13, 2016 at 12:23 PM, Konstantin Khlebnikov > > wrote: > >> On Wed, Jan 13, 2016 at 7:09 PM, Kees Cook wrote: > >>> On Wed, Jan

Re: [Ocfs2-devel] [PATCH] quota: constify qtree_fmt_operations structures

2016-01-04 Thread Jan Kara
ta_global.c > +++ b/fs/ocfs2/quota_global.c > @@ -123,7 +123,7 @@ static int ocfs2_global_is_id(void *dp, struct dquot > *dquot) > dquot->dq_id); > } > > -struct qtree_fmt_operations ocfs2_global_ops = { &g

Re: [Ocfs2-devel] [PATCH V2] jbd2: fix null committed data return in undo_access

2015-12-02 Thread Jan Kara
38.406686] RIP [] > ocfs2_block_group_clear_bits+0x23b/0x250 [ocfs2] > [ 6538.406686] RSP > [ 6538.691128] ---[ end trace 31cd7011d6770d7e ]--- > [ 6538.694492] Kernel panic - not syncing: Fatal exception > [ 6538.695484] Kernel Offset: disabled > > Fixes: de92c8caf16c(&q

Re: [Ocfs2-devel] [PATCH] jbd2: fix null committed data return in undo_access

2015-11-27 Thread Jan Kara
#x27;false' instead of 0. > JBUFFER_TRACE(jh, "entry"); > - if (jbd2_write_access_granted(handle, bh)) > + if (jbd2_write_access_granted(handle, bh, 1)) Here 'true' instead of 1. Thanks. Honza -- Jan Kara SUSE Labs, CR ___ Ocfs2-devel mailing list Ocfs2-devel@oss.oracle.com https://oss.oracle.com/mailman/listinfo/ocfs2-devel

Re: [Ocfs2-devel] [PATCH] mm: Allow GFP_IOFS for page_cache_read page cache allocation

2015-11-12 Thread Jan Kara
; I would like to hear FS and other MM people about the proposed interface. > Using mapping_gfp_mask blindly doesn't sound good to me and vm_fault > looks like a proper channel to communicate between MM and FS layers. > > Comments? Are there any better ideas? Makes sense to me

Re: [Ocfs2-devel] [PATCH] dquot_initialize() can now return error. Handle it where possible

2015-07-16 Thread Jan Kara
On Wed 15-07-15 13:53:19, Dave Kleikamp wrote: > Slightly modified by Dave Kleikamp due to needed jfs_rename() error path fix. > > Signed-off-by: Jan Kara > Reviewed-by: Dave Kleikamp Thanks! I have picked up both patches for now so that I have the series consistent. I will wait fo

[Ocfs2-devel] [PATCH 0/6] quota: Propagate errors when creating quota entry

2015-07-15 Thread Jan Kara
Hello, this patch set makes quota code report errors when quota entry creation fails (upto now such errors were silently ignored). Filesystems can then properly handle the errors and report them to userspace. Patch set also includes patches to all filesystems to properly handle the errors.

[Ocfs2-devel] [PATCH 3/6] ext4: Handle error from dquot_initialize()

2015-07-15 Thread Jan Kara
dquot_initialize() can now return error. Handle it where possible. Signed-off-by: Jan Kara --- fs/ext4/ialloc.c | 6 -- fs/ext4/inode.c | 7 +-- fs/ext4/namei.c | 63 ++-- 3 files changed, 56 insertions(+), 20 deletions(-) diff

[Ocfs2-devel] [PATCH 4/6] ocfs2: Handle error from dquot_initialize()

2015-07-15 Thread Jan Kara
dquot_initialize() can now return error. Handle it where possible. Signed-off-by: Jan Kara --- fs/ocfs2/file.c | 14 fs/ocfs2/namei.c| 59 + fs/ocfs2/refcounttree.c | 5 +++-- 3 files changed, 58 insertions(+), 20

[Ocfs2-devel] [PATCH 5/6] jfs: Handle error from dquot_initialize()

2015-07-15 Thread Jan Kara
dquot_initialize() can now return error. Handle it where possible. Signed-off-by: Jan Kara --- fs/jfs/file.c | 7 +-- fs/jfs/jfs_inode.c | 4 +++- fs/jfs/namei.c | 53 +++-- 3 files changed, 47 insertions(+), 17 deletions(-) diff

[Ocfs2-devel] [PATCH 6/6] reiserfs: Handle error from dquot_initialize()

2015-07-15 Thread Jan Kara
dquot_initialize() can now return error. Handle it where possible. Signed-off-by: Jan Kara --- fs/reiserfs/inode.c | 7 -- fs/reiserfs/namei.c | 63 - 2 files changed, 53 insertions(+), 17 deletions(-) diff --git a/fs/reiserfs/inode.c b

[Ocfs2-devel] [PATCH 2/6] ext2: Handle error from dquot_initalize()

2015-07-15 Thread Jan Kara
dquot_initialize() can now return error. Handle it where possible. Signed-off-by: Jan Kara --- fs/ext2/ialloc.c | 5 - fs/ext2/inode.c | 7 +-- fs/ext2/namei.c | 46 ++ 3 files changed, 43 insertions(+), 15 deletions(-) diff --git a/fs

[Ocfs2-devel] [PATCH 1/6] quota: Propagate error from ->acquire_dquot()

2015-07-15 Thread Jan Kara
From: Jan Kara 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

Re: [Ocfs2-devel] [PATCH RESEND] jbd2: fix ocfs2 corrupt when updating journal superblock fails

2015-06-15 Thread Jan Kara
unsigned long > block); > +int __jbd2_update_log_tail(journal_t *journal, tid_t tid, unsigned long > block); > void jbd2_update_log_tail(journal_t *journal, tid_t tid, unsigned long > block); > > /* Commit management */ > @@ -1157,7 +1157,7 @@ extern int jbd2_journal_r

Re: [Ocfs2-devel] A question about function jbd2__journal_restart()

2015-04-14 Thread Jan Kara
ransaction and can not ensure the > consistency. It is the caller's responsibility to keep things consistently > before call jbd2__journal_restart(), right? Correct. Honza -- Jan Kara SUSE Labs, CR

Re: [Ocfs2-devel] vfs: Add general support to enforce project quota limits

2015-04-13 Thread Jan Kara
rojid set anywhere? Cscope and smatch can't find it if > it is. Not yet. There are ext4 patches floating around that will use this. Honza -- Jan Kara SUSE Labs, CR ___ Ocfs2-devel mailing list Ocfs2-devel@oss.oracle.com https://oss.oracle.com/mailman/listinfo/ocfs2-devel

Re: [Ocfs2-devel] vfs: Add general support to enforce project quota limits

2015-04-13 Thread Jan Kara
SK_USR | QTYPE_MASK_GRP so type == 2 cannot reach it via quotactl(). So either this is a false positive or there's some other path how type == 2 can reach OCFS2 which I'm missing and I'd definitely like to learn about it. Can you investigate a bit please? Thanks. Honza -- Jan Kara SUSE Labs, CR ___ Ocfs2-devel mailing list Ocfs2-devel@oss.oracle.com https://oss.oracle.com/mailman/listinfo/ocfs2-devel

[Ocfs2-devel] [PATCH 03/16] quota: Wire up ->quota_{enable, disable} callbacks into Q_QUOTA{ON, OFF}

2015-01-26 Thread Jan Kara
Make Q_QUOTAON / Q_QUOTAOFF quotactl call ->quota_enable / ->quota_disable callback when provided. To match current behavior of ocfs2 & ext4 we make these quotactls turn on / off quota enforcement for appropriate quota type. Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara ---

[Ocfs2-devel] [PATCH 14/16] quota: Make ->set_info use structure with neccesary info to VFS and XFS

2015-01-26 Thread Jan Kara
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 --- fs/quota/dquot.c | 27 --- fs/quota/quota.c |

[Ocfs2-devel] [PATCH 16/16] quota: Hook up Q_XSETQLIM for id 0 to ->set_info

2015-01-26 Thread Jan Kara
ent transactions - one for setting timers and warning limits and one for setting space and inode limits. Although this is inefficient, it is rare enough that it does not matter. Signed-off-by: Jan Kara --- fs/quota/quota.c | 39 +++ 1 file changed, 39 inserti

[Ocfs2-devel] [PATCH 06/16] ocfs2: Use generic helpers for quotaon and quotaoff

2015-01-26 Thread Jan Kara
happen only if the filesystem has the quota feature set). Signed-off-by: Jan Kara --- fs/ocfs2/super.c | 32 +--- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 83723179e1ec..706c71c2955d 100644 --- a/fs/ocfs2

[Ocfs2-devel] [PATCH 01/16] quota: Switch ->get_dqblk() and ->set_dqblk() to use bytes as space units

2015-01-26 Thread Jan Kara
nes 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: sta...@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara --- fs/gfs2/quota.c

[Ocfs2-devel] [PATCH 11/16] xfs: Convert to using ->get_state callback

2015-01-26 Thread Jan Kara
Convert xfs to use ->get_state callback instead of ->get_xstate and ->get_xstatev. Signed-off-by: Jan Kara --- fs/xfs/xfs_qm.h | 4 -- fs/xfs/xfs_qm_syscalls.c | 176 --- fs/xfs/xfs_quotaops.c| 98 +++---

[Ocfs2-devel] [PATCH 05/16] ext4: Use generic helpers for quotaon and quotaoff

2015-01-26 Thread Jan Kara
corresponding quota type is enabled (which can happen only if quota feature is set). Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara --- fs/ext4/super.c | 42 +- 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4

[Ocfs2-devel] [PATCH 00/16 v4] quota: Unify VFS and XFS quota interfaces

2015-01-26 Thread Jan Kara
Hello, this is another iteration of patches to unify VFS and XFS quota interfaces so that XFS quotactls work for filesystems with VFS quotas and vice versa. This is useful so that userspace doesn't have to care that much about which filesystem it is using at least when using basic quota funct

[Ocfs2-devel] [PATCH 08/16] quota: Store maximum space limit in bytes

2015-01-26 Thread Jan Kara
: Christoph Hellwig Signed-off-by: Jan Kara --- fs/ocfs2/quota_local.c | 4 ++-- fs/quota/dquot.c | 18 -- fs/quota/quota_v1.c| 4 ++-- fs/quota/quota_v2.c| 10 +- include/linux/quota.h | 4 ++-- 5 files changed, 15 insertions(+), 25 deletions(-) diff

[Ocfs2-devel] [PATCH 07/16] quota: Remove quota_on_meta callback

2015-01-26 Thread Jan Kara
There are no more users for quota_on_meta callback. Just remove it. Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara --- fs/quota/quota.c | 5 + include/linux/quota.h | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/fs/quota/quota.c b/fs/quota/quota.c index

[Ocfs2-devel] [PATCH 10/16] quota: Wire up Q_GETXSTATE and Q_GETXSTATV calls to work with ->get_state

2015-01-26 Thread Jan Kara
Add appropriate conversion functions so that filesystems supporting ->get_state() method can be queried using Q_GETXSTATE and Q_GETXSTATV calls. Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara --- fs/quota/quota.c | 138 +-- 1 f

[Ocfs2-devel] [PATCH 09/16] quota: Make VFS quotas use new interface for getting quota info

2015-01-26 Thread Jan Kara
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 Signed-off-by: Jan Kara --- fs/ext3/super.c | 2 +- fs/ext4/super.c

[Ocfs2-devel] [PATCH 15/16] xfs: Add support for Q_SETINFO

2015-01-26 Thread Jan Kara
Add support to XFS so that time limits can be set through Q_SETINFO quotactl. Signed-off-by: Jan Kara --- fs/xfs/xfs_quotaops.c | 37 + 1 file changed, 37 insertions(+) diff --git a/fs/xfs/xfs_quotaops.c b/fs/xfs/xfs_quotaops.c index df9835396c4f

[Ocfs2-devel] [PATCH 04/16] quota: Add ->quota_{enable, disable} callbacks for VFS quotas

2015-01-26 Thread Jan Kara
or for quotactl using these functions which can be used by filesystems with quota files stored in hidden system files. Signed-off-by: Jan Kara --- fs/quota/dquot.c | 91 include/linux/quotaops.h | 1 + 2 files changed, 92 insertions(+) diff --gi

[Ocfs2-devel] [PATCH 02/16] quota: Split ->set_xstate callback into two

2015-01-26 Thread Jan Kara
Split ->set_xstate callback into two callbacks - one for turning quotas on (->quota_enable) and one for turning quotas off (->quota_disable). That way we don't have to pass quotactl command into the callback which seems cleaner. Reviewed-by: Christoph Hellwig Signed-off-by: Jan

[Ocfs2-devel] [PATCH 13/16] quota: Remove ->get_xstate and ->get_xstatev callbacks

2015-01-26 Thread Jan Kara
These callbacks are now unused. Remove them. Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara --- fs/quota/quota.c | 14 -- include/linux/quota.h | 2 -- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/fs/quota/quota.c b/fs/quota/quota.c index

[Ocfs2-devel] [PATCH 12/16] gfs2: Convert to using ->get_state callback

2015-01-26 Thread Jan Kara
Convert gfs2 to use ->get_state callback instead of ->get_xstate. Signed-off-by: Jan Kara --- fs/gfs2/quota.c | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 3e193cb36996..c76e031ccbb4 100644 --

Re: [Ocfs2-devel] [PATCH 0/17 v3] quota: Unify VFS and XFS quota interfaces

2015-01-21 Thread Jan Kara
On Thu 22-01-15 08:38:26, Dave Chinner wrote: > On Fri, Jan 16, 2015 at 01:47:34PM +0100, Jan Kara wrote: > > Hello, > > > > this is another iteration of patches to unify VFS and XFS quota > > interfaces so > > that XFS quotactls work for filesyste

[Ocfs2-devel] [PATCH] ocfs2: Remove pointless assignment from ocfs2_calc_refcount_meta_credits()

2015-01-21 Thread Jan Kara
The assigned value is never used. Coverity-id: 1226847 CC: Mark Fasheh CC: Joel Becker Signed-off-by: Jan Kara --- fs/ocfs2/refcounttree.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index d81f6e2a97f5..ee541f92dab4 100644 --- a/fs

Re: [Ocfs2-devel] [PATCH 12/17] xfs: Convert to using ->get_state callback

2015-01-20 Thread Jan Kara
need to pass mp, as it can be derived as ip->i_mount. Good point. > Btw, I think this code should move into xfs_quotaops.c now > that it ties into the Linux quota interface, and xfs_qm_scall_getstate > should be folded into xfs_fs_get_quota_state. OK, will do.

Re: [Ocfs2-devel] [PATCH 09/17] quota: Make Q_XQUOTASYNC support VFS quota syncing

2015-01-20 Thread Jan Kara
On Mon 19-01-15 01:09:14, Christoph Hellwig wrote: > On Fri, Jan 16, 2015 at 01:47:43PM +0100, Jan Kara wrote: > > Call ->quota_sync method from Q_XQUOTASYNC for better userspace > > compatibility. > > Q_XQUOTASYNC never did the equivalent to ->quota_sync, but rat

Re: [Ocfs2-devel] [PATCH 05/17] ocfs2: Use generic helpers for quotaon and quotaoff

2015-01-20 Thread Jan Kara
On Mon 19-01-15 01:03:47, Christoph Hellwig wrote: > On Fri, Jan 16, 2015 at 01:47:39PM +0100, Jan Kara wrote: > > Ocfs2 can just use the generic helpers provided by quota code for > > turning quotas on and off when quota files are stored as system inodes. > > The only diff

Re: [Ocfs2-devel] [PATCH 03/17] quota: Add ->quota_{enable, disable} callbacks for VFS quotas

2015-01-20 Thread Jan Kara
On Mon 19-01-15 01:02:48, Christoph Hellwig wrote: > On Fri, Jan 16, 2015 at 01:47:37PM +0100, Jan Kara wrote: > > +EXPORT_SYMBOL(dquot_quota_enable); > > > +EXPORT_SYMBOL(dquot_quota_disable); > > I can't find any modular users of this (in fact none outside this &g

Re: [Ocfs2-devel] [PATCH 02/17] quota: Wire up ->quota_{enable, disable} callbacks into Q_QUOTA{ON, OFF}

2015-01-20 Thread Jan Kara
On Mon 19-01-15 01:01:21, Christoph Hellwig wrote: > On Fri, Jan 16, 2015 at 01:47:36PM +0100, Jan Kara wrote: > > Make Q_QUOTAON / Q_QUOTAOFF quotactl call ->quota_enable / > > ->quota_disable callback when provided. To match current behavior of > > ocfs2 & ext4

Re: [Ocfs2-devel] [PATCH 07/17] quota: Switch ->get_dqblk() and ->set_dqblk() to use bytes as space units

2015-01-20 Thread Jan Kara
them in the XFS parts of quota code (maybe he didn't realize that to be able to use them I have to move the definitions somewhere where quota code can include them). Dave? I personally don't care which variant will get used... > Otherwise looks good: > > Reviewed-by: Christ

Re: [Ocfs2-devel] [PATCH 1/4] quota: Don't store flags for v2 quota format

2015-01-19 Thread Jan Kara
On Mon 19-01-15 01:14:32, Christoph Hellwig wrote: > On Thu, Jan 15, 2015 at 11:13:10AM +0100, Jan Kara wrote: > > Hum, I'm not sure I follow you. Current kernels will store any 32-bit > > number user sets in flags field. So if we wanted to be 100% safe, we'd have >

[Ocfs2-devel] [PATCH 06/17] quota: Remove quota_on_meta callback

2015-01-16 Thread Jan Kara
There are no more users for quota_on_meta callback. Just remove it. Signed-off-by: Jan Kara --- fs/quota/quota.c | 5 + include/linux/quota.h | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/fs/quota/quota.c b/fs/quota/quota.c index 748716ffee48..f30f9c4ce784 100644

[Ocfs2-devel] [PATCH 12/17] xfs: Convert to using ->get_state callback

2015-01-16 Thread Jan Kara
Convert xfs to use ->get_state callback instead of ->get_xstate and ->get_xstatev. Signed-off-by: Jan Kara --- fs/xfs/xfs_qm.h | 6 +- fs/xfs/xfs_qm_syscalls.c | 219 --- fs/xfs/xfs_quotaops.c| 26 +- 3 files changed, 58 i

  1   2   3   4   5   6   7   8   >