[Devel,RHEL7,COMMIT] pfcache: fix misplaced endline in ext4_xattr_trusted_csum_list

Submitted by Kirill Tkhai on Sept. 26, 2016, 1:33 p.m.

Details

Message ID 201609261333.u8QDXsYR029972@pro
State New
Series "pfcache: fix misplaced endline in ext4_xattr_trusted_csum_list"
Headers show

Commit Message

Kirill Tkhai Sept. 26, 2016, 1:33 p.m.
The commit is pushed to "branch-rh7-3.10.0-327.28.2.vz7.17.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.28.2.vz7.17.10
------>
commit a59e4367aa083bad891c0fa6fe1fce28a3c7a07d
Author: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Date:   Mon Sep 26 13:32:53 2016 +0000

    pfcache: fix misplaced endline in ext4_xattr_trusted_csum_list
    
    It is the fix for commit 00ebb1860eff ("pfcache: hide
    trusted.pfcache from listxattr")
    
    Else entries in list are not separated and getfattr fails:
    
    getfattr -d -m trusted /vz/root/110/testfile
    vz/root/110/testfile: trusted.pfcache�trusted.test: No such attribute
    
    https://jira.sw.ru/browse/PSBM-52574
    Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
    Acked-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 fs/ext4/pfcache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/fs/ext4/pfcache.c b/fs/ext4/pfcache.c
index 52bd886..256d2a7 100644
--- a/fs/ext4/pfcache.c
+++ b/fs/ext4/pfcache.c
@@ -776,7 +776,7 @@  ext4_xattr_trusted_csum_list(struct dentry *dentry, char *list, size_t list_size
 
 	if (list && len <= list_size) {
 		memcpy(list, XATTR_TRUSTED_CSUM_PREFIX, XATTR_TRUSTED_CSUM_PREFIX_LEN);
-		list[len] = '\0';
+		list[XATTR_TRUSTED_CSUM_PREFIX_LEN] = '\0';
 	}
 	return len;
 }

Comments

Kirill Tkhai Sept. 27, 2016, 2:13 p.m.
This commit is reverted.

On 26.09.2016 16:33, Kirill Tkhai wrote:
> The commit is pushed to "branch-rh7-3.10.0-327.28.2.vz7.17.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
> after rh7-3.10.0-327.28.2.vz7.17.10
> ------>
> commit a59e4367aa083bad891c0fa6fe1fce28a3c7a07d
> Author: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
> Date:   Mon Sep 26 13:32:53 2016 +0000
> 
>     pfcache: fix misplaced endline in ext4_xattr_trusted_csum_list
>     
>     It is the fix for commit 00ebb1860eff ("pfcache: hide
>     trusted.pfcache from listxattr")
>     
>     Else entries in list are not separated and getfattr fails:
>     
>     getfattr -d -m trusted /vz/root/110/testfile
>     vz/root/110/testfile: trusted.pfcache�trusted.test: No such attribute
>     
>     https://jira.sw.ru/browse/PSBM-52574
>     Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
>     Acked-by: Kirill Tkhai <ktkhai@virtuozzo.com>
> ---
>  fs/ext4/pfcache.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ext4/pfcache.c b/fs/ext4/pfcache.c
> index 52bd886..256d2a7 100644
> --- a/fs/ext4/pfcache.c
> +++ b/fs/ext4/pfcache.c
> @@ -776,7 +776,7 @@ ext4_xattr_trusted_csum_list(struct dentry *dentry, char *list, size_t list_size
>  
>  	if (list && len <= list_size) {
>  		memcpy(list, XATTR_TRUSTED_CSUM_PREFIX, XATTR_TRUSTED_CSUM_PREFIX_LEN);
> -		list[len] = '\0';
> +		list[XATTR_TRUSTED_CSUM_PREFIX_LEN] = '\0';
>  	}
>  	return len;
>  }
>