]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - fs/cifs/inode.c
CIFS: Fix mkdir/rmdir bug for the non-POSIX case
authorPavel Shilovsky <piastry@etersoft.ru>
Fri, 17 Feb 2012 13:13:30 +0000 (16:13 +0300)
committerSteve French <smfrench@gmail.com>
Mon, 27 Feb 2012 04:59:43 +0000 (22:59 -0600)
commit6de2ce423157d06f73d570ef7044f08c2f8697da
tree02fac16a0307d7323dc676ee034dbc555bf6d383
parent203738e548cefc3fc3c2f73a9063176c9f3583d5
CIFS: Fix mkdir/rmdir bug for the non-POSIX case

Currently we do inc/drop_nlink for a parent directory for every
mkdir/rmdir calls. That's wrong when Unix extensions are disabled
because in this case a server doesn't follow the same semantic and
returns the old value on the next QueryInfo request. As the result,
we update our value with the server one and then decrement it on
every rmdir call - go to negative nlink values.

Fix this by removing inc/drop_nlink for the parent directory from
mkdir/rmdir, setting it for a revalidation and ignoring NumberOfLinks
for directories when Unix extensions are disabled.

Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Reviewed-by: Jeff Layton <jlayton@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
fs/cifs/inode.c