]> git.karo-electronics.de Git - karo-tx-linux.git/commit
cifs: fix length calculation for converted unicode readdir names
authorJeff Layton <jlayton@redhat.com>
Fri, 5 Feb 2010 18:14:00 +0000 (13:14 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 23 Feb 2010 15:37:50 +0000 (07:37 -0800)
commitea332d671c5f6802d85572c2af13b9a671d8ea88
tree86b04731314837213e42a69882a4d4d9f526c358
parent35e2093d5d7b632c083af3578c05876375828314
cifs: fix length calculation for converted unicode readdir names

commit f12f98dba6ea1517cd7fbb912208893b9c014c15 upstream.

cifs_from_ucs2 returns the length of the converted name, including the
length of the NULL terminator. We don't want to include the NULL
terminator in the dentry name length however since that'll throw off the
hash calculation for the dentry cache.

I believe that this is the root cause of several problems that have
cropped up recently that seem to be papered over with the "noserverino"
mount option. More confirmation of that would be good, but this is
clearly a bug and it fixes at least one reproducible problem that
was reported.

This patch fixes at least this reproducer in this kernel.org bug:

    http://bugzilla.kernel.org/show_bug.cgi?id=15088#c12

Reported-by: Bjorn Tore Sund <bjorn.sund@it.uib.no>
Acked-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/cifs/readdir.c