ovl: allow zero size xattr
authorMiklos Szeredi <miklos@szeredi.hu>
Tue, 10 Nov 2015 16:08:41 +0000 (17:08 +0100)
committerMiklos Szeredi <miklos@szeredi.hu>
Tue, 10 Nov 2015 16:08:41 +0000 (17:08 +0100)
When ovl_copy_xattr() encountered a zero size xattr no more xattrs were
copied and the function returned success.  This is clearly not the desired
behavior.

Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Cc: <stable@vger.kernel.org>
fs/overlayfs/copy_up.c

index 871fcb67be9741f2aab81f3d6552306dedf4c967..394e87f8340f7b15d39e948f82fa3d5d6509b456 100644 (file)
@@ -54,7 +54,7 @@ int ovl_copy_xattr(struct dentry *old, struct dentry *new)
 
        for (name = buf; name < (buf + list_size); name += strlen(name) + 1) {
                size = vfs_getxattr(old, name, value, XATTR_SIZE_MAX);
-               if (size <= 0) {
+               if (size < 0) {
                        error = size;
                        goto out_free_value;
                }
This page took 0.027204 seconds and 5 git commands to generate.