Re: [PATCH] writeback: remove unused parameter from balance_dirty_pages()

2017-10-02 Thread Tahsin Erdogan
On Mon, Oct 2, 2017 at 12:56 AM, Michal Hocko wrote: > balance_dirty_pages_ratelimited doesn't really need mapping as well. All > it needs is the inode and we already have it in callers. So would it > make sense to refactor a bit further and make its argument an inode? My only

Re: [PATCH] writeback: remove unused parameter from balance_dirty_pages()

2017-10-02 Thread Tahsin Erdogan
On Mon, Oct 2, 2017 at 12:56 AM, Michal Hocko wrote: > balance_dirty_pages_ratelimited doesn't really need mapping as well. All > it needs is the inode and we already have it in callers. So would it > make sense to refactor a bit further and make its argument an inode? My only concern is that,

[PATCH] writeback: remove unused parameter from balance_dirty_pages()

2017-09-27 Thread Tahsin Erdogan
"mapping" parameter to balance_dirty_pages() is not used anymore. Fixes: dfb8ae567835 ("writeback: let balance_dirty_pages() work on the matching cgroup bdi_writeback") Signed-off-by: Tahsin Erdogan <tah...@google.com> --- mm/page-writeback.c | 5 ++--- 1 file c

[PATCH] writeback: remove unused parameter from balance_dirty_pages()

2017-09-27 Thread Tahsin Erdogan
"mapping" parameter to balance_dirty_pages() is not used anymore. Fixes: dfb8ae567835 ("writeback: let balance_dirty_pages() work on the matching cgroup bdi_writeback") Signed-off-by: Tahsin Erdogan --- mm/page-writeback.c | 5 ++--- 1 file changed, 2 insertions(+), 3 dele

[PATCH] tracing: fix trace_pipe behavior for instance traces

2017-09-17 Thread Tahsin Erdogan
e Signed-off-by: Tahsin Erdogan <tah...@google.com> --- kernel/trace/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 5360b7aec57a..f8d986d736b7 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@

[PATCH] tracing: fix trace_pipe behavior for instance traces

2017-09-17 Thread Tahsin Erdogan
e Signed-off-by: Tahsin Erdogan --- kernel/trace/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 5360b7aec57a..f8d986d736b7 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -5667,7 +5667,7 @@ s

Re: xattr hash error in 4.13-rc with overlayfs over ext4

2017-08-06 Thread Tahsin Erdogan
On Sun, Aug 6, 2017 at 5:47 AM, zhangyi (F) wrote: > I think the root cause of this problem is the hash value not updated > when we overwrite the same xattr, please see ext4_xattr_set_entry(): Yes, you are right. Thanks a lot for finding the root cause. I just sent out a

Re: xattr hash error in 4.13-rc with overlayfs over ext4

2017-08-06 Thread Tahsin Erdogan
On Sun, Aug 6, 2017 at 5:47 AM, zhangyi (F) wrote: > I think the root cause of this problem is the hash value not updated > when we overwrite the same xattr, please see ext4_xattr_set_entry(): Yes, you are right. Thanks a lot for finding the root cause. I just sent out a fix: ("[PATCH] ext4:

[PATCH] ext4: add missing xattr hash update

2017-08-06 Thread Tahsin Erdogan
(yizhang...@gmail.com) for root causing the problem. Fixes: daf8328172df ("ext4: eliminate xattr entry e_hash recalculation for removes") Reported-by: Miklos Szeredi <mik...@szeredi.hu> Signed-off-by: Tahsin Erdogan <tah...@google.com> --- fs/ext4/xattr.c | 6 -- 1 file

[PATCH] ext4: add missing xattr hash update

2017-08-06 Thread Tahsin Erdogan
(yizhang...@gmail.com) for root causing the problem. Fixes: daf8328172df ("ext4: eliminate xattr entry e_hash recalculation for removes") Reported-by: Miklos Szeredi Signed-off-by: Tahsin Erdogan --- fs/ext4/xattr.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff

Re: xattr hash error in 4.13-rc with overlayfs over ext4

2017-07-27 Thread Tahsin Erdogan
Still no luck reproducing the error. I am using the test script below at v4.13-rc2. Do you mind checking my script to see what I am missing? #!/bin/bash set -ex while grep /dev/sdb /proc/mounts;do umount /dev/sdb; done mke2fs -F -t ext4 /dev/sdb mount /dev/sdb /mnt/sdb cd /mnt/sdb mkdir

Re: xattr hash error in 4.13-rc with overlayfs over ext4

2017-07-27 Thread Tahsin Erdogan
Still no luck reproducing the error. I am using the test script below at v4.13-rc2. Do you mind checking my script to see what I am missing? #!/bin/bash set -ex while grep /dev/sdb /proc/mounts;do umount /dev/sdb; done mke2fs -F -t ext4 /dev/sdb mount /dev/sdb /mnt/sdb cd /mnt/sdb mkdir

Re: xattr hash error in 4.13-rc with overlayfs over ext4

2017-07-27 Thread Tahsin Erdogan
Hi Miklos, I made a first attempt to reproduce the failure but did not get lucky. > Inode 3093, i_blocks is 16, should be 8. Fix? yes Does this inode correspond to foo, bar or a preexisting file? Do you mind sharing the output of the following command? debugfs -R "stat <3093>" /dev/${ext4_dev}

Re: xattr hash error in 4.13-rc with overlayfs over ext4

2017-07-27 Thread Tahsin Erdogan
Hi Miklos, I made a first attempt to reproduce the failure but did not get lucky. > Inode 3093, i_blocks is 16, should be 8. Fix? yes Does this inode correspond to foo, bar or a preexisting file? Do you mind sharing the output of the following command? debugfs -R "stat <3093>" /dev/${ext4_dev}

[PATCH] ext4: backward compatibility support for Lustre ea_inode implementation

2017-07-24 Thread Tahsin Erdogan
uncharge is skipped if the flag is set. Signed-off-by: Tahsin Erdogan <tah...@google.com> --- fs/ext4/ext4.h | 1 + fs/ext4/inode.c | 8 fs/ext4/xattr.c | 141 +--- 3 files changed, 94 insertions(+), 56 deletions(-) diff --git a/f

[PATCH] ext4: backward compatibility support for Lustre ea_inode implementation

2017-07-24 Thread Tahsin Erdogan
uncharge is skipped if the flag is set. Signed-off-by: Tahsin Erdogan --- fs/ext4/ext4.h | 1 + fs/ext4/inode.c | 8 fs/ext4/xattr.c | 141 +--- 3 files changed, 94 insertions(+), 56 deletions(-) diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4

[PATCH] ext4: remove unused mode parameter

2017-07-20 Thread Tahsin Erdogan
ext4_alloc_file_blocks() does not use its mode parameter. Remove it. Fixes: 0e8b6879f3c2 ("ext4: refactor ext4_fallocate code") Signed-off-by: Tahsin Erdogan <tah...@google.com> --- fs/ext4/extents.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/f

[PATCH] ext4: remove unused mode parameter

2017-07-20 Thread Tahsin Erdogan
ext4_alloc_file_blocks() does not use its mode parameter. Remove it. Fixes: 0e8b6879f3c2 ("ext4: refactor ext4_fallocate code") Signed-off-by: Tahsin Erdogan --- fs/ext4/extents.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/ext4/extents.c b/fs/ext4

Re: [PATCH v2] ext4: make xattr inode reads faster

2017-07-17 Thread Tahsin Erdogan
uld be better to do the error cleanup once at the end of the function, > instead of multiple times in the code, like: > > if (IS_ERR(bhs[i])) { > err = PTR_ERR(bhs[i]); > bh_count = i; > goto out_bre

Re: [PATCH v2] ext4: make xattr inode reads faster

2017-07-17 Thread Tahsin Erdogan
uld be better to do the error cleanup once at the end of the function, > instead of multiple times in the code, like: > > if (IS_ERR(bhs[i])) { > err = PTR_ERR(bhs[i]); > bh_count = i; > goto ou

[PATCH v2] ext4: make xattr inode reads faster

2017-07-17 Thread Tahsin Erdogan
to complete. A similar logic is used in ext4_find_entry(), so update that code to use the new function. Signed-off-by: Tahsin Erdogan <tah...@google.com> --- v2: - updated ext4_find_entry() to also use ext4_bread_batch() - added wait parameter to ext4_bread_batch() fs/ext4/ext4.h | 2 ++ f

[PATCH v2] ext4: make xattr inode reads faster

2017-07-17 Thread Tahsin Erdogan
to complete. A similar logic is used in ext4_find_entry(), so update that code to use the new function. Signed-off-by: Tahsin Erdogan --- v2: - updated ext4_find_entry() to also use ext4_bread_batch() - added wait parameter to ext4_bread_batch() fs/ext4/ext4.h | 2 ++ fs/ext4/inode.c | 44

[PATCH] ext4: inplace xattr block update fails to deduplicate blocks

2017-07-14 Thread Tahsin Erdogan
r.2 -v bbb /mnt/sdb/x setfattr -n user.1 -v aaa /mnt/sdb/y setfattr -n user.2 -v bbb /mnt/sdb/y debugfs -R 'stat x' /dev/sdb | cat debugfs -R 'stat y' /dev/sdb | cat This patch defers the reinsertion to the cache so that we can locate other blocks with the same contents. Signed-off-by: Tahs

[PATCH] ext4: inplace xattr block update fails to deduplicate blocks

2017-07-14 Thread Tahsin Erdogan
r.2 -v bbb /mnt/sdb/x setfattr -n user.1 -v aaa /mnt/sdb/y setfattr -n user.2 -v bbb /mnt/sdb/y debugfs -R 'stat x' /dev/sdb | cat debugfs -R 'stat y' /dev/sdb | cat This patch defers the reinsertion to the cache so that we can locate other blocks with the same contents. Signed-off-by: Tahs

[PATCH] ext4: make xattr inode reads faster

2017-07-12 Thread Tahsin Erdogan
ext4_xattr_inode_read() currently reads each block sequentially while waiting for io operation to complete before moving on to the next block. This prevents request merging in block layer. Fix this by starting reads for all blocks then wait for completions. Signed-off-by: Tahsin Erdogan <

[PATCH] ext4: make xattr inode reads faster

2017-07-12 Thread Tahsin Erdogan
ext4_xattr_inode_read() currently reads each block sequentially while waiting for io operation to complete before moving on to the next block. This prevents request merging in block layer. Fix this by starting reads for all blocks then wait for completions. Signed-off-by: Tahsin Erdogan --- fs

[PATCH 2/2] ext4: fix __ext4_new_inode() journal credits calculation

2017-07-05 Thread Tahsin Erdogan
__ext4_new_inode() because all attributes are known to be new, so we can save credits that are normally needed to delete old values. Also, have fscrypt specify its maximum context size so that we don't end up allocating credits for 64k size. Signed-off-by: Tahsin Erdogan <tah...@google.com> --- fs/

[PATCH 2/2] ext4: fix __ext4_new_inode() journal credits calculation

2017-07-05 Thread Tahsin Erdogan
__ext4_new_inode() because all attributes are known to be new, so we can save credits that are normally needed to delete old values. Also, have fscrypt specify its maximum context size so that we don't end up allocating credits for 64k size. Signed-off-by: Tahsin Erdogan --- fs/crypto/policy.c

[PATCH 1/2] ext4: skip ext4_init_security() and encryption on ea_inodes

2017-07-05 Thread Tahsin Erdogan
Extended attribute inodes are internal to ext4. Adding encryption/security related attributes on them would mean dealing with nested calls into ea code. Since they have no direct exposure to user mode, just avoid creating ea entries for them. Signed-off-by: Tahsin Erdogan <tah...@google.

[PATCH 1/2] ext4: skip ext4_init_security() and encryption on ea_inodes

2017-07-05 Thread Tahsin Erdogan
Extended attribute inodes are internal to ext4. Adding encryption/security related attributes on them would mean dealing with nested calls into ea code. Since they have no direct exposure to user mode, just avoid creating ea entries for them. Signed-off-by: Tahsin Erdogan --- fs/ext4/ialloc.c

Re: [PATCH v2] ext4: have ext4_xattr_set_handle() allocate journal credits

2017-07-04 Thread Tahsin Erdogan
> Are you aware of other cases where we're likely to run into problems > besides ext4_new_inode()? Nope. If we can get ext4_new_inode() case covered we should be fine. I will abandon this patch and will work on a patch that adds extra credits in __ext4_new_inode(). thanks

Re: [PATCH v2] ext4: have ext4_xattr_set_handle() allocate journal credits

2017-07-04 Thread Tahsin Erdogan
> Are you aware of other cases where we're likely to run into problems > besides ext4_new_inode()? Nope. If we can get ext4_new_inode() case covered we should be fine. I will abandon this patch and will work on a patch that adds extra credits in __ext4_new_inode(). thanks

Re: [PATCH v2] ext4: have ext4_xattr_set_handle() allocate journal credits

2017-06-30 Thread Tahsin Erdogan
> One problem with this approach is that restarting the transaction handle will > make the xattr update non-atomic, which could be a real problem for some > workloads. For example, ACLs or SELinux or fscrypt xattrs being added in > a separate transaction from file creation, or being modified

Re: [PATCH v2] ext4: have ext4_xattr_set_handle() allocate journal credits

2017-06-30 Thread Tahsin Erdogan
> One problem with this approach is that restarting the transaction handle will > make the xattr update non-atomic, which could be a real problem for some > workloads. For example, ACLs or SELinux or fscrypt xattrs being added in > a separate transaction from file creation, or being modified

[PATCH v2] ext4: have ext4_xattr_set_handle() allocate journal credits

2017-06-28 Thread Tahsin Erdogan
;ext4: improve journal credit handling in set xattr paths") Signed-off-by: Tahsin Erdogan <tah...@google.com> --- v2: Allocate 1 journal credit in ext4_set_acl() and ext4_set_context() for modifying inode outside ext4_xattr_set_handle() call. fs/ext4/acl.c | 14 +++---

[PATCH v2] ext4: have ext4_xattr_set_handle() allocate journal credits

2017-06-28 Thread Tahsin Erdogan
;ext4: improve journal credit handling in set xattr paths") Signed-off-by: Tahsin Erdogan --- v2: Allocate 1 journal credit in ext4_set_acl() and ext4_set_context() for modifying inode outside ext4_xattr_set_handle() call. fs/ext4/acl.c | 14 +++--- fs/ext4/su

[PATCH] ext4: have ext4_xattr_set_handle() allocate journal credits

2017-06-28 Thread Tahsin Erdogan
;ext4: improve journal credit handling in set xattr paths") Signed-off-by: Tahsin Erdogan <tah...@google.com> --- fs/ext4/acl.c | 10 +++--- fs/ext4/super.c | 9 +++-- fs/ext4/xattr.c | 39 +++ fs/ext4/xattr.h | 2 -- 4 files changed, 13 i

[PATCH] ext4: have ext4_xattr_set_handle() allocate journal credits

2017-06-28 Thread Tahsin Erdogan
;ext4: improve journal credit handling in set xattr paths") Signed-off-by: Tahsin Erdogan --- fs/ext4/acl.c | 10 +++--- fs/ext4/super.c | 9 +++-- fs/ext4/xattr.c | 39 +++ fs/ext4/xattr.h | 2 -- 4 files changed, 13 insertions(+), 47 deletion

[PATCH] ext4: fix __ext4_xattr_set_credits()

2017-06-28 Thread Tahsin Erdogan
;ext4: xattr inode deduplication") Signed-off-by: Tahsin Erdogan <tah...@google.com> --- fs/ext4/xattr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index ce12c3fb7e59..062756b4e6d8 100644 --- a/fs/ext4/xattr.c +++ b

[PATCH] ext4: fix __ext4_xattr_set_credits()

2017-06-28 Thread Tahsin Erdogan
;ext4: xattr inode deduplication") Signed-off-by: Tahsin Erdogan --- fs/ext4/xattr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index ce12c3fb7e59..062756b4e6d8 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -845,6 +845,9

[PATCH] ext4: fast symlink test should not rely on i_blocks

2017-06-27 Thread Tahsin Erdogan
ymlink has no data stored in i_data. Fixes: 74c5bfa651af ("ext4: xattr inode deduplication") Suggested-by: Andreas Dilger <adil...@dilger.ca> Signed-off-by: Tahsin Erdogan <tah...@google.com> --- fs/ext4/inode.c | 20 +--- 1 file changed, 13 insertions(+), 7 d

[PATCH] ext4: fast symlink test should not rely on i_blocks

2017-06-27 Thread Tahsin Erdogan
ymlink has no data stored in i_data. Fixes: 74c5bfa651af ("ext4: xattr inode deduplication") Suggested-by: Andreas Dilger Signed-off-by: Tahsin Erdogan --- fs/ext4/inode.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ex

Re: [PATCH] ext4: Return EIO on read error in ext4_find_entry

2017-06-26 Thread Tahsin Erdogan
On Thu, Jun 22, 2017 at 4:23 PM, Khazhismel Kumykov wrote: > - /* read error, skip block & hope for the best */ > EXT4_ERROR_INODE(dir, "reading directory lblock %lu", > (unsigned long)

Re: [PATCH] ext4: Return EIO on read error in ext4_find_entry

2017-06-26 Thread Tahsin Erdogan
On Thu, Jun 22, 2017 at 4:23 PM, Khazhismel Kumykov wrote: > - /* read error, skip block & hope for the best */ > EXT4_ERROR_INODE(dir, "reading directory lblock %lu", > (unsigned long) block); >

Re: [PATCH][ext4-next] ext4: ensure error return ret is zero on successful return

2017-06-23 Thread Tahsin Erdogan
On Fri, Jun 23, 2017 at 7:58 AM, Colin King <colin.k...@canonical.com> wrote: > The error return ret is not set on a successful return path and > so it returns a garbage value. Ensure it is is set to zero on > a successful return. Thanks for catching this bug! Reviewed-by: Tahs

Re: [PATCH][ext4-next] ext4: ensure error return ret is zero on successful return

2017-06-23 Thread Tahsin Erdogan
On Fri, Jun 23, 2017 at 7:58 AM, Colin King wrote: > The error return ret is not set on a successful return path and > so it returns a garbage value. Ensure it is is set to zero on > a successful return. Thanks for catching this bug! Reviewed-by: Tahsin Erdogan

[PATCH 32/32] ext4: add nombcache mount option

2017-06-21 Thread Tahsin Erdogan
The main purpose of mb cache is to achieve deduplication in extended attributes. In use cases where opportunity for deduplication is unlikely, it only adds overhead. Add a mount option to explicitly turn off mb cache. Suggested-by: Andreas Dilger <adil...@dilger.ca> Signed-off-by: Tahsin E

[PATCH 32/32] ext4: add nombcache mount option

2017-06-21 Thread Tahsin Erdogan
The main purpose of mb cache is to achieve deduplication in extended attributes. In use cases where opportunity for deduplication is unlikely, it only adds overhead. Add a mount option to explicitly turn off mb cache. Suggested-by: Andreas Dilger Signed-off-by: Tahsin Erdogan --- v2

[PATCH 27/32] ext4: xattr inode deduplication

2017-06-21 Thread Tahsin Erdogan
the inode is deleted. The quota charging for such inodes is manually managed. Every reference holder is charged the full size as if there was no sharing happening. This is consistent with how xattr blocks are also charged. Signed-off-by: Tahsin Erdogan <tah...@google.com> --- v6: - Fixed

[PATCH 27/32] ext4: xattr inode deduplication

2017-06-21 Thread Tahsin Erdogan
the inode is deleted. The quota charging for such inodes is manually managed. Every reference holder is charged the full size as if there was no sharing happening. This is consistent with how xattr blocks are also charged. Signed-off-by: Tahsin Erdogan --- v6: - Fixed error message "F

[PATCH 25/32] ext4: add ext4_is_quota_file()

2017-06-21 Thread Tahsin Erdogan
to make the distinction clear. Replace IS_NOQUOTA() call with ext4_is_quota_file() at places where we are checking for quota files. Signed-off-by: Tahsin Erdogan <tah...@google.com> --- fs/ext4/ext4.h| 2 ++ fs/ext4/inode.c | 2 +- fs/ext4/ioctl.c | 4 ++-- fs/ext4/mba

[PATCH 25/32] ext4: add ext4_is_quota_file()

2017-06-21 Thread Tahsin Erdogan
to make the distinction clear. Replace IS_NOQUOTA() call with ext4_is_quota_file() at places where we are checking for quota files. Signed-off-by: Tahsin Erdogan --- fs/ext4/ext4.h| 2 ++ fs/ext4/inode.c | 2 +- fs/ext4/ioctl.c | 4 ++-- fs/ext4/mballoc.c | 2 +- fs/ext4

[PATCH 31/32] ext4: strong binding of xattr inode references

2017-06-21 Thread Tahsin Erdogan
. This is done regardless of whether the entry lives in the inode body or external attribute block. Signed-off-by: Tahsin Erdogan <tah...@google.com> --- v2: naming updates to adapt to other patch changes in the series fs/ext4/xattr.c | 104 +++-

[PATCH 31/32] ext4: strong binding of xattr inode references

2017-06-21 Thread Tahsin Erdogan
. This is done regardless of whether the entry lives in the inode body or external attribute block. Signed-off-by: Tahsin Erdogan --- v2: naming updates to adapt to other patch changes in the series fs/ext4/xattr.c | 104 +++- 1 file changed, 65 insertions

[PATCH 26/32] ext4: cleanup transaction restarts during inode deletion

2017-06-21 Thread Tahsin Erdogan
ext4_xattr_ensure_credits() helper function which takes care of journal extend/restart logic. It also handles getting jbd2 write access and dirty metadata calls. This function is called at every iteration of handling an ea_inode reference. Signed-off-by: Tahsin Erdogan <tah...@google.com>

[PATCH 26/32] ext4: cleanup transaction restarts during inode deletion

2017-06-21 Thread Tahsin Erdogan
ext4_xattr_ensure_credits() helper function which takes care of journal extend/restart logic. It also handles getting jbd2 write access and dirty metadata calls. This function is called at every iteration of handling an ea_inode reference. Signed-off-by: Tahsin Erdogan --- v3: fixed checkpatch.pl

[PATCH 29/32] ext4: reserve space for xattr entries/names

2017-06-21 Thread Tahsin Erdogan
31 Signed-off-by: Tahsin Erdogan <tah...@google.com> --- fs/ext4/xattr.c | 20 1 file changed, 20 insertions(+) diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index a3f8bf4558f3..835b3dca5b65 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -1446,6 +1446,12 @@

[PATCH 29/32] ext4: reserve space for xattr entries/names

2017-06-21 Thread Tahsin Erdogan
31 Signed-off-by: Tahsin Erdogan --- fs/ext4/xattr.c | 20 1 file changed, 20 insertions(+) diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index a3f8bf4558f3..835b3dca5b65 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -1446,6 +1446,12 @@ static int

[PATCH 30/32] ext4: eliminate xattr entry e_hash recalculation for removes

2017-06-21 Thread Tahsin Erdogan
hen to recalculate hash to ext4_xattr_set_entry(). Signed-off-by: Tahsin Erdogan <tah...@google.com> --- fs/ext4/xattr.c | 50 ++ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 835b3dca5b65..9cb

[PATCH 28/32] quota: add get_inode_usage callback to transfer multi-inode charges

2017-06-21 Thread Tahsin Erdogan
-by: Tahsin Erdogan <tah...@google.com> Acked-by: Jan Kara <j...@suse.cz> --- v3: added Acked-by v2: - added get_inode_usage() callback to query total inodes charge to be transferred fs/ext4/inode.c | 7 +++ fs/ext4/ioctl.c | 6 ++ fs/ext4/super.

[PATCH 30/32] ext4: eliminate xattr entry e_hash recalculation for removes

2017-06-21 Thread Tahsin Erdogan
hen to recalculate hash to ext4_xattr_set_entry(). Signed-off-by: Tahsin Erdogan --- fs/ext4/xattr.c | 50 ++ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 835b3dca5b65..9cb15f2069bd 100644 --- a/fs/e

[PATCH 28/32] quota: add get_inode_usage callback to transfer multi-inode charges

2017-06-21 Thread Tahsin Erdogan
-by: Tahsin Erdogan Acked-by: Jan Kara --- v3: added Acked-by v2: - added get_inode_usage() callback to query total inodes charge to be transferred fs/ext4/inode.c | 7 +++ fs/ext4/ioctl.c | 6 ++ fs/ext4/super.c | 21 ++-- fs/ext4/xattr.c

[PATCH 24/32] ext2, ext4: make mb block cache names more explicit

2017-06-21 Thread Tahsin Erdogan
There will be a second mb_cache instance that tracks ea_inodes. Make existing names more explicit so that it is clear that they refer to xattr block cache. Signed-off-by: Tahsin Erdogan <tah...@google.com> --- v2: - renamed s_mb_cache to s_mb_block_cache in both ext2 and ext4 - renamed

[PATCH 24/32] ext2, ext4: make mb block cache names more explicit

2017-06-21 Thread Tahsin Erdogan
There will be a second mb_cache instance that tracks ea_inodes. Make existing names more explicit so that it is clear that they refer to xattr block cache. Signed-off-by: Tahsin Erdogan --- v2: - renamed s_mb_cache to s_mb_block_cache in both ext2 and ext4 - renamed local variables named ext

Re: [PATCH 32/32] ext4: add nombcache mount option

2017-06-21 Thread Tahsin Erdogan
>> + if ((sbi->s_mount_opt ^ old_opts.s_mount_opt) & EXT4_MOUNT_NO_MBCACHE) >> { >> + ext4_msg(sb, KERN_ERR, "can't enable nombcache during >> remount"); >> + err = -EINVAL; >> + goto restore_opts; >> + } > > It appears that this restriction also

Re: [PATCH 32/32] ext4: add nombcache mount option

2017-06-21 Thread Tahsin Erdogan
>> + if ((sbi->s_mount_opt ^ old_opts.s_mount_opt) & EXT4_MOUNT_NO_MBCACHE) >> { >> + ext4_msg(sb, KERN_ERR, "can't enable nombcache during >> remount"); >> + err = -EINVAL; >> + goto restore_opts; >> + } > > It appears that this restriction also

Re: [PATCH v2 23/31] mbcache: make mbcache naming more generic

2017-06-21 Thread Tahsin Erdogan
Hi Andreas, I have incorporated your suggestions into another patch that renames things in ext2/ext4 ("[PATCH 24/32] ext2, ext4: make mb block cache names more explicit"). > Since we now also have the ea_inode cache, it would be better to rename > s_mb_cache to s_mb_block_cache to make it more

Re: [PATCH v2 23/31] mbcache: make mbcache naming more generic

2017-06-21 Thread Tahsin Erdogan
Hi Andreas, I have incorporated your suggestions into another patch that renames things in ext2/ext4 ("[PATCH 24/32] ext2, ext4: make mb block cache names more explicit"). > Since we now also have the ea_inode cache, it would be better to rename > s_mb_cache to s_mb_block_cache to make it more

Re: [PATCH v5 27/28] ext4: xattr inode deduplication

2017-06-21 Thread Tahsin Erdogan
> Tashin, we are already using the "no_mbcache" option name, so would prefer > to keep that working. It would be OK to accept both option names to mean > the same thing, and only document the "nombcache" option. Updated patch to accept both nombcache and no_mbcache. >> struct mb_cache

Re: [PATCH v5 27/28] ext4: xattr inode deduplication

2017-06-21 Thread Tahsin Erdogan
> Tashin, we are already using the "no_mbcache" option name, so would prefer > to keep that working. It would be OK to accept both option names to mean > the same thing, and only document the "nombcache" option. Updated patch to accept both nombcache and no_mbcache. >> struct mb_cache

[PATCH 03/32] ext4: lock inode before calling ext4_orphan_add()

2017-06-21 Thread Tahsin Erdogan
entry_SYSCALL_64_fastpath+0x18/0xad Signed-off-by: Tahsin Erdogan <tah...@google.com> --- fs/ext4/xattr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 26d2705950a5..09ba0137d529 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -

[PATCH 03/32] ext4: lock inode before calling ext4_orphan_add()

2017-06-21 Thread Tahsin Erdogan
entry_SYSCALL_64_fastpath+0x18/0xad Signed-off-by: Tahsin Erdogan --- fs/ext4/xattr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 26d2705950a5..09ba0137d529 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -1963,7 +1963,9

[PATCH 04/32] ext4: do not set posix acls on xattr inodes

2017-06-21 Thread Tahsin Erdogan
0 SyS_setxattr+0xf/0x20 entry_SYSCALL_64_fastpath+0x18/0xad Signed-off-by: Tahsin Erdogan <tah...@google.com> --- fs/ext4/ext4.h| 11 ++- fs/ext4/ialloc.c | 14 +- fs/ext4/migrate.c | 2 +- fs/ext4/xattr.c | 3 ++- 4 files changed, 18 insertions(+), 12 deletio

[PATCH 01/32] ext4: xattr-in-inode support

2017-06-21 Thread Tahsin Erdogan
Signed-off-by: Kalpak Shah <kalpak.s...@sun.com> Signed-off-by: James Simmons <uja.o...@gmail.com> Signed-off-by: Andreas Dilger <andreas.dil...@intel.com> Signed-off-by: Tahsin Erdogan <tah...@google.com> --- fs/ext4/ext4.h | 12 ++ fs/ext4/ialloc.c | 1 - fs/ext4/inline

[PATCH 04/32] ext4: do not set posix acls on xattr inodes

2017-06-21 Thread Tahsin Erdogan
0 SyS_setxattr+0xf/0x20 entry_SYSCALL_64_fastpath+0x18/0xad Signed-off-by: Tahsin Erdogan --- fs/ext4/ext4.h| 11 ++- fs/ext4/ialloc.c | 14 +- fs/ext4/migrate.c | 2 +- fs/ext4/xattr.c | 3 ++- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/fs/

[PATCH 01/32] ext4: xattr-in-inode support

2017-06-21 Thread Tahsin Erdogan
ff-by: James Simmons Signed-off-by: Andreas Dilger Signed-off-by: Tahsin Erdogan --- fs/ext4/ext4.h | 12 ++ fs/ext4/ialloc.c | 1 - fs/ext4/inline.c | 2 +- fs/ext4/inode.c | 49 - fs/ext4/xattr.c | 565 ++- fs/ext4/xattr.h

[PATCH 06/32] ext4: ea_inode owner should be the same as the inode owner

2017-06-21 Thread Tahsin Erdogan
Quota charging is based on the ownership of the inode. Currently, the xattr inode owner is set to the caller which may be different from the parent inode owner. This is inconsistent with how quota is charged for xattr block and regular data block writes. Signed-off-by: Tahsin Erdogan <

[PATCH 06/32] ext4: ea_inode owner should be the same as the inode owner

2017-06-21 Thread Tahsin Erdogan
Quota charging is based on the ownership of the inode. Currently, the xattr inode owner is set to the caller which may be different from the parent inode owner. This is inconsistent with how quota is charged for xattr block and regular data block writes. Signed-off-by: Tahsin Erdogan --- fs

[PATCH 07/32] ext4: call journal revoke when freeing ea_inode blocks

2017-06-21 Thread Tahsin Erdogan
ea_inode contents are treated as metadata, that's why it is journaled during initial writes. Failing to call revoke during freeing could cause user data to be overwritten with original ea_inode contents during journal replay. Signed-off-by: Tahsin Erdogan <tah...@google.com> --- f

[PATCH 02/32] ext4: fix lockdep warning about recursive inode locking

2017-06-21 Thread Tahsin Erdogan
__vfs_setxattr_noperm+0x69/0x1c0 vfs_setxattr+0xa2/0xb0 setxattr+0x12e/0x150 path_setxattr+0x87/0xb0 SyS_setxattr+0xf/0x20 entry_SYSCALL_64_fastpath+0x18/0xad Signed-off-by: Tahsin Erdogan <tah...@google.com> --- fs/ext4/inode.c | 2 ++ fs/ext4/xattr.c | 8 fs/ext4/xattr.h | 6 ++

[PATCH 07/32] ext4: call journal revoke when freeing ea_inode blocks

2017-06-21 Thread Tahsin Erdogan
ea_inode contents are treated as metadata, that's why it is journaled during initial writes. Failing to call revoke during freeing could cause user data to be overwritten with original ea_inode contents during journal replay. Signed-off-by: Tahsin Erdogan --- fs/ext4/extents.c | 3 ++- fs/ext4

[PATCH 02/32] ext4: fix lockdep warning about recursive inode locking

2017-06-21 Thread Tahsin Erdogan
__vfs_setxattr_noperm+0x69/0x1c0 vfs_setxattr+0xa2/0xb0 setxattr+0x12e/0x150 path_setxattr+0x87/0xb0 SyS_setxattr+0xf/0x20 entry_SYSCALL_64_fastpath+0x18/0xad Signed-off-by: Tahsin Erdogan --- fs/ext4/inode.c | 2 ++ fs/ext4/xattr.c | 8 fs/ext4/xattr.h | 6 ++ 3 files changed, 16 in

[PATCH 10/32] ext4: change ext4_xattr_inode_iget() signature

2017-06-21 Thread Tahsin Erdogan
In general, kernel functions indicate success/failure through their return values. This function returns the status as an output parameter and reserves the return value for the inode. Make it follow the general convention. Signed-off-by: Tahsin Erdogan <tah...@google.com> --- fs/ext4/x

[PATCH 05/32] ext4: attach jinode after creation of xattr inode

2017-06-21 Thread Tahsin Erdogan
-by: Tahsin Erdogan <tah...@google.com> --- fs/ext4/xattr.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 12210fe87ea3..8e123533315f 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -826,6 +826,7 @@ static struct inode *ext4_xattr_inode_

[PATCH 10/32] ext4: change ext4_xattr_inode_iget() signature

2017-06-21 Thread Tahsin Erdogan
In general, kernel functions indicate success/failure through their return values. This function returns the status as an output parameter and reserves the return value for the inode. Make it follow the general convention. Signed-off-by: Tahsin Erdogan --- fs/ext4/xattr.c | 73

[PATCH 05/32] ext4: attach jinode after creation of xattr inode

2017-06-21 Thread Tahsin Erdogan
-by: Tahsin Erdogan --- fs/ext4/xattr.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 12210fe87ea3..8e123533315f 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -826,6 +826,7 @@ static struct inode *ext4_xattr_inode_create(handle_t *handle

[PATCH 11/32] ext4: clean up ext4_xattr_inode_get()

2017-06-21 Thread Tahsin Erdogan
the expected size, ext4_bread() may return NULL which would indicate data corruption. Signed-off-by: Tahsin Erdogan <tah...@google.com> --- fs/ext4/xattr.c | 35 +-- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/fs/ext4/xattr.c b/fs/ext4/x

[PATCH 11/32] ext4: clean up ext4_xattr_inode_get()

2017-06-21 Thread Tahsin Erdogan
the expected size, ext4_bread() may return NULL which would indicate data corruption. Signed-off-by: Tahsin Erdogan --- fs/ext4/xattr.c | 35 +-- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index d9477d01be9b

[PATCH 14/32] ext4: fix ext4_xattr_make_inode_space() value size calculation

2017-06-21 Thread Tahsin Erdogan
-by: Tahsin Erdogan <tah...@google.com> --- fs/ext4/xattr.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 681a9b5eefd8..6a6bee246873 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -1747,9 +1747,10 @@ stat

[PATCH 14/32] ext4: fix ext4_xattr_make_inode_space() value size calculation

2017-06-21 Thread Tahsin Erdogan
-by: Tahsin Erdogan --- fs/ext4/xattr.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 681a9b5eefd8..6a6bee246873 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -1747,9 +1747,10 @@ static int ext4_xattr_make_inode_space

[PATCH 12/32] ext4: add missing le32_to_cpu(e_value_inum) conversions

2017-06-21 Thread Tahsin Erdogan
Two places in code missed converting xattr inode number using le32_to_cpu(). Signed-off-by: Tahsin Erdogan <tah...@google.com> --- fs/ext4/xattr.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 8e855fc2eb03..4dd8be

[PATCH 12/32] ext4: add missing le32_to_cpu(e_value_inum) conversions

2017-06-21 Thread Tahsin Erdogan
Two places in code missed converting xattr inode number using le32_to_cpu(). Signed-off-by: Tahsin Erdogan --- fs/ext4/xattr.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 8e855fc2eb03..4dd8be16d175 100644 --- a/fs/ext4

[PATCH 15/32] ext4: fix ext4_xattr_move_to_block()

2017-06-21 Thread Tahsin Erdogan
When moving xattr entries from inline area to a xattr block, entries that refer to external xattr inodes need special handling because value data is not available in the inline area but rather should be read from its external inode. Signed-off-by: Tahsin Erdogan <tah...@google.com> --- f

[PATCH 15/32] ext4: fix ext4_xattr_move_to_block()

2017-06-21 Thread Tahsin Erdogan
When moving xattr entries from inline area to a xattr block, entries that refer to external xattr inodes need special handling because value data is not available in the inline area but rather should be read from its external inode. Signed-off-by: Tahsin Erdogan --- fs/ext4/xattr.c | 19

[PATCH 16/32] ext4: fix ext4_xattr_cmp()

2017-06-21 Thread Tahsin Erdogan
When a xattr entry refers to an external inode, the value data is not available in the inline area so we should not attempt to read it using value offset. Signed-off-by: Tahsin Erdogan <tah...@google.com> --- fs/ext4/xattr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[PATCH 13/32] ext4: ext4_xattr_value_same() should return false for external data

2017-06-21 Thread Tahsin Erdogan
ext4_xattr_value_same() is used as a quick optimization in case the new xattr value is identical to the previous value. When xattr value is stored in a xattr inode the check becomes expensive so it is better to just assume that they are not equal. Signed-off-by: Tahsin Erdogan <tah...@google.

[PATCH 16/32] ext4: fix ext4_xattr_cmp()

2017-06-21 Thread Tahsin Erdogan
When a xattr entry refers to an external inode, the value data is not available in the inline area so we should not attempt to read it using value offset. Signed-off-by: Tahsin Erdogan --- fs/ext4/xattr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/ext4/xattr.c b/fs

[PATCH 13/32] ext4: ext4_xattr_value_same() should return false for external data

2017-06-21 Thread Tahsin Erdogan
ext4_xattr_value_same() is used as a quick optimization in case the new xattr value is identical to the previous value. When xattr value is stored in a xattr inode the check becomes expensive so it is better to just assume that they are not equal. Signed-off-by: Tahsin Erdogan --- fs/ext4

[PATCH 18/32] ext4: retry storing value in external inode with xattr block too

2017-06-21 Thread Tahsin Erdogan
try loop to do that. It also makes the caller the sole decider on whether to store a value in an external inode. Signed-off-by: Tahsin Erdogan <tah...@google.com> --- v2: fix checkpatch.pl warning about indented retry_inode: label fs/ext4/xattr.c | 35 ++

[PATCH 20/32] ext4: improve journal credit handling in set xattr paths

2017-06-21 Thread Tahsin Erdogan
there is a possiblity that the initially calculated credits are not sufficient anymore. Signed-off-by: Tahsin Erdogan <tah...@google.com> --- v2: fixed checkpatch.pl warning about replacing spaces with tab fs/ext4/acl.c | 7 --- fs/ext4/ext4_jbd2.h | 14 -- fs/ext4/super.c

  1   2   3   4   >