]> git.baikalelectronics.ru Git - kernel.git/commit
nfs: fix nfs4d readlink truncated packet
authorAvi Kivity <avi@cloudius-systems.com>
Thu, 26 Jun 2014 14:23:12 +0000 (17:23 +0300)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 2 Jul 2014 21:37:13 +0000 (17:37 -0400)
commita1b3d5ce5acd67be33394126a481695c2d579827
treeb1a964247f6e28d25d44605ed811daa681ac0a10
parent5960fd46ce1ff76c8a1c2fa0aa29d781cb230e95
nfs: fix nfs4d readlink truncated packet

XDR requires 4-byte alignment; nfs4d READLINK reply writes out the padding,
but truncates the packet to the padding-less size.

Fix by taking the padding into consideration when truncating the packet.

Symptoms:

# ll /mnt/
ls: cannot read symbolic link /mnt/test: Input/output error
total 4
-rw-r--r--. 1 root root  0 Jun 14 01:21 123456
lrwxrwxrwx. 1 root root  6 Jul  2 03:33 test
drwxr-xr-x. 1 root root  0 Jul  2 23:50 tmp
drwxr-xr-x. 1 root root 60 Jul  2 23:44 tree

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Fixes: f4d174e6eac3 (nfsd4: don't treat readlink like a zero-copy operation)
Reviewed-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4xdr.c