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, ba
"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
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
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: add
(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
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 xattrhas
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}
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
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
i]);
>
> It would 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;
>
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
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.
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
__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/pol
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
> 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
> 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 (dele
"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/ex
"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 del
;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
size = 0 symlink 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
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);
>
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
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
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 "Fail
nt 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
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
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
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
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
-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
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
>> + 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 applie
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 cle
> 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 *s_m
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
0xb0
setxattr+0x129/0x160
path_setxattr+0x87/0xb0
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,
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
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
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
er_set+0x34/0x40
__vfs_setxattr+0x66/0x80
__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 +
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
: 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
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
: 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
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
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
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
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
a retry 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
---
v2: fix checkpatch.pl warning about indented retry_inode: label
fs/ext4/xattr.c | 35 ++-
1 file changed, 18 in
possiblity that the initially calculated
credits are not sufficient anymore.
Signed-off-by: Tahsin Erdogan
---
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 | 6 +++---
fs/ext4/xattr.c
Since this is a xattr specific data structure it is cleaner to keep it in
xattr header file.
Signed-off-by: Tahsin Erdogan
---
fs/ext4/ext4.h | 4
fs/ext4/xattr.h | 5 +
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 603edb5ff304
-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
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
---
v5:
- made ext4_meta_trans_blocks
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 8284cdfe7d80..e5ff4d5a0618 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -1446,6 +1446,12 @@ static int
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 e5ff4d5a0618..b1bd60244978 100644
--- a/fs/e
nt 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
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
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
---
fs/ext4/ext4
ock number or an inode number.
Signed-off-by: Tahsin Erdogan
---
v3: removed space after typecast
v2: updated commit title and description
fs/ext2/xattr.c | 18 +-
fs/ext4/xattr.c | 10 +-
fs/mbcache.c
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
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
In a few places the function returns without trying to pass the actual
error code to the caller. Fix those.
Signed-off-by: Tahsin Erdogan
---
fs/ext4/xattr.c | 16 ++--
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index
When there is no space for a value in xattr block, it may be stored
in an xattr inode even if the value length is less than
EXT4_XATTR_MIN_LARGE_EA_SIZE(). So the current assumption in credits
calculation is wrong.
Signed-off-by: Tahsin Erdogan
---
fs/ext4/xattr.c | 3 +--
1 file changed, 1
Tracking struct inode * rather than the inode number eliminates the
repeated ext4_xattr_inode_iget() call later. The second call cannot
fail in practice but still requires explanation when it wants to ignore
the return value. Avoid the trouble and make things simple.
Signed-off-by: Tahsin Erdogan
enabled. In non-journaled case,r
we fail to release the ref count causing an error message like below.
"VFS: Busy inodes after unmount of sdb. Self-destruct in 5 seconds.
Have a nice day..."
Signed-off-by: Tahsin Erdogan
---
fs/ext4/xattr.c | 3 +--
1 file changed, 1 insertion(+), 2
EXT4_XATTR_MAX_LARGE_EA_SIZE definition in ext4 is currently unused.
Besides, vfs enforces its own 64k limit which makes the 1MB limit in
ext4 redundant. Remove it.
Signed-off-by: Tahsin Erdogan
---
fs/ext4/ext4.h | 6 --
1 file changed, 6 deletions(-)
diff --git a/fs/ext4/ext4.h b/fs/ext4
On Tue, Jun 20, 2017 at 9:48 PM, Theodore Ts'o wrote:
> Tahsin, when you think we've closed on the reviews, could you send out
> a complete set of all of the patches on a new mail thread, using git
> send-email so I can make sure I'm grabbing the final version of all of
> the patches in this patch
-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
On Mon, Jun 19, 2017 at 5:36 AM, Jan Kara wrote:
> On Mon 19-06-17 04:46:00, Tahsin Erdogan wrote:
>> >> I tried that approach by adding a "int get_inode_usage(struct inode
>> >> *inode, qsize_t *usage)" callback to dquot_operations. Unfortunately,
>>
On Mon, Jun 19, 2017 at 5:36 AM, Jan Kara wrote:
> Heh, this "pushing of responsibility" looks like a silly game. If an error
> can happen in a function, it is better to report it as far as easily
> possible (unless we can cleanly handle it which we cannot here). I'm guilty
> of making dquot_free_
; Should skip mb_cache if EA_INODE_CACHE(inode) is NULL, or have a wrapper
> like ext4_xattr_inode_cache_insert() to match ext4_xattr_inode_cache_find()
> that does the same.
Added skip in patch ("[PATCH 32/32] ext4: add nombcache mount option")
On Tue, Jun 20, 2017 at 2:07 AM, Ta
not sure whether that
version can be simplified.
On Tue, Jun 20, 2017 at 2:04 AM, Tahsin Erdogan wrote:
> During inode deletion, journal credits that will be needed are hard to
> determine, that is why we have journal extend/restart calls in several
> places. Whenever a transaction is rest
possiblity that the initially calculated
credits are not sufficient anymore.
Signed-off-by: Tahsin Erdogan
---
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 | 6 +++---
fs/ext4/xattr.c
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
---
fs/ext4/ext4
-by: Tahsin Erdogan
---
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 | 54
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
---
v5:
- made ext4_meta_trans_blocks
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
ock number or an inode number.
Signed-off-by: Tahsin Erdogan
---
v2: updated commit title and description
fs/ext2/xattr.c | 18 +-
fs/ext4/xattr.c | 10 +-
fs/mbcache.c| 43 +--
include/linux/mbca
a retry 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
---
v2: fix checkpatch.pl warning about indented retry_inode: label
fs/ext4/xattr.c | 35 ++-
1 file changed, 18 in
>> I tried that approach by adding a "int get_inode_usage(struct inode
>> *inode, qsize_t *usage)" callback to dquot_operations. Unfortunately,
>> ext4 code that calculates the number of internal inodes
>> (ext4_xattr_inode_count()) is subject to failures so the callback has
>> to be able to report
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 you don't have to pass aditional argument
> to ext4_xattr_set_entry()) and calling
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 it
> in dquot_transfer(), dquot_free_inode(), dquot_alloc_inode().
I tried that approach by addi
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 that, having names that are more generic
which do not limit use cases to block sharing. In a
On Wed, Jun 14, 2017 at 4:05 PM, Darrick J. Wong
wrote:
> Why not just spill the values into their own ea_inodes if we need the
> space? I guess that has the disadvantage that now we need to reserve
> quite a few more journal credits ((1 inode block, 1 bbitmap block, 1
> ibitmap block, 1 data blo
done regardless of whether the entry lives in
the inode body or external attribute block.
Signed-off-by: Tahsin Erdogan
---
fs/ext4/xattr.c | 106 +++-
1 file changed, 67 insertions(+), 39 deletions(-)
diff --git a/fs/ext4/xattr.c b/fs/ext4
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 c9579d220a0c..6c6dce2f874e 100644
--- a/fs/e
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 3ad1fc62cbf0..c9579d220a0c 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -1428,6 +1428,12 @@ static int
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
---
v4:
- eliminated xattr entry in the
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
---
v2: made
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
---
v3:
- use s_csum_seed for hash
> Hmm... normally we'd supply sbi->s_csum_seed as the second argument so
> that the metadata checksum value also has the fs uuid stamped into it.
I have thought about using sbi->s_csum_seed and was a little hesitant
because it involves adding more complexity to e2fsprogs to handle
cases like chang
ff-by: James Simmons
Signed-off-by: Andreas Dilger
Signed-off-by: Alexander Boyko
Signed-off-by: Tahsin Erdogan
---
v2:
- Added Alexander Boyko to signed off list per note from
Andrew Perepechko
fs/ext4/ext4.h | 12 ++
fs/ext4/ialloc.c | 1 -
fs/ext4/inline.c | 2 +-
fs/ext4/inod
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
---
v2:
- make dependency on crc32c
> I think it would be wise not to support !extents && ea_inode,
> particularly since blockmaps aren't protected by metadata_csum and so in
> the long run it's probably best to minimize the introduction of new
> blockmap files (on ext4 anyway).
Sounds good. I will add that to e2fsprogs patches. tha
>> allowing the ext4/e2fsck to verify the correct inode is accessed.
>
> Can we store the checksum of the xattr value somewhere? We already
> checksum the values if they're stored in the ibody or a single external
> block, and I'd hate to lose that protection.
>
> We could probably reuse one of th
Hi Darrick,
>> -#define EXT4_XATTR_MAX_LARGE_EA_SIZE(1024 * 1024)
>
> Uhhh... didn't you add this in patch 1/28? There's little point in
> adding a symbol just to delete it shortly thereafter.
>
1/28 is the original patch I've received from Andreas. I wanted to
leave his patch in its original
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
0xb0
setxattr+0x129/0x160
path_setxattr+0x87/0xb0
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,
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
1 - 100 of 197 matches
Mail list logo