From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: qstr abuse in git-cifs Date: Mon, 5 Nov 2007 23:28:43 -0800 Message-ID: <20071105232843.6c34313e.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org To: Steven French Return-path: Received: from smtp2.linux-foundation.org ([207.189.120.14]:48377 "EHLO smtp2.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750741AbXKFHeF (ORCPT ); Tue, 6 Nov 2007 02:34:05 -0500 Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org static int cifs_ci_compare(struct dentry *dentry, struct qstr *a, struct qstr *b) { struct nls_table *codepage = CIFS_SB(dentry->d_inode->i_sb)->local_nls; if ((a->len == b->len) && (nls_strnicmp(codepage, a->name, b->name, a->len) == 0)) { /* * To preserve case, don't let an existing negative dentry's * case take precedence. If a is not a negative dentry, this * should have no side effects */ memcpy(a->name, b->name, a->len); return 0; } return 1; } produces fs/cifs/dir.c: In function 'cifs_ci_compare': fs/cifs/dir.c:596: warning: passing argument 1 of '__constant_memcpy' discards qualifiers from pointer target type fs/cifs/dir.c:596: warning: passing argument 1 of '__memcpy' discards qualifiers from pointer target type I suspect that bad things are happening in there. It's strange for a "comparison" function to go and alter one of the things which it's comparing, too.