From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerome de Vivie Subject: Does struct qstr->name should be terminated ? Date: Tue, 23 Mar 2004 11:56:01 +0100 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <406017C1.4080005@free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mx.laposte.net ([81.255.54.11]:34755 "EHLO mx.laposte.net") by vger.kernel.org with ESMTP id S262465AbUCWLI3 (ORCPT ); Tue, 23 Mar 2004 06:08:29 -0500 Received: from free.fr (81.50.75.81) by mx.laposte.net (7.0.024) (authenticated as jerome.de-vivie@laposte.net) id 406001200000AAAA for linux-fsdevel@vger.kernel.org; Tue, 23 Mar 2004 12:08:26 +0100 To: linux-fsdevel@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org I've work with "struct qstr" for a while without bothering with the last caracter: qstr->name[qstr->len]. I get oops from my module but after investigation, i found lines in fs/namei.c that are using this caracter: In do_rename: /* unless the source is a directory trailing slashes give -ENOTDIR */ if (!S_ISDIR(old_dentry->d_inode->i_mode)) { error = -ENOTDIR; if (oldnd.last.name[oldnd.last.len]) goto exit4; if (newnd.last.name[newnd.last.len]) goto exit4; } So, do i need to initialize this caracter when allocating new qstr ? Is this caracter is used in other place in the VFS ? regards, j.