NFSv4 only print the label when its queried

[ Upstream commit 2c52c8376d ]

When the bitmask of the attributes doesn't include the security label,
don't bother printing it. Since the label might not be null terminated,
adjust the printing format accordingly.

Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Olga Kornievskaia 2021-11-29 15:33:56 -05:00 коммит произвёл Greg Kroah-Hartman
Родитель 38ae938701
Коммит bbf647eceb
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -4197,10 +4197,11 @@ static int decode_attr_security_label(struct xdr_stream *xdr, uint32_t *bitmap,
} else } else
printk(KERN_WARNING "%s: label too long (%u)!\n", printk(KERN_WARNING "%s: label too long (%u)!\n",
__func__, len); __func__, len);
if (label && label->label)
dprintk("%s: label=%.*s, len=%d, PI=%d, LFS=%d\n",
__func__, label->len, (char *)label->label,
label->len, label->pi, label->lfs);
} }
if (label && label->label)
dprintk("%s: label=%s, len=%d, PI=%d, LFS=%d\n", __func__,
(char *)label->label, label->len, label->pi, label->lfs);
return status; return status;
} }