From patchwork Fri Jan 4 10:43:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ycnian@gmail.com X-Patchwork-Id: 1932561 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 3A08C3FDDA for ; Fri, 4 Jan 2013 11:00:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754453Ab3ADLAJ (ORCPT ); Fri, 4 Jan 2013 06:00:09 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:39585 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754459Ab3ADLAI (ORCPT ); Fri, 4 Jan 2013 06:00:08 -0500 Received: by mail-pa0-f44.google.com with SMTP id hz11so9210792pad.31 for ; Fri, 04 Jan 2013 03:00:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=JZSrHfZ+cyBDadYmFgCZPeW4hddjyOVIyYVr0t8m9Ik=; b=YEben+T5Po+WOk9k+/UwQH4aV6EzJ3CRpyzPXCGbnA1fuOiVfvAVI1EsmJKzKz3Uyj bq5E9M6/LAtgH7l4Ya62YoZWcTHaQkrNduSuJ/Bki2emk5lfT8Qwt2AAaqpG6uRH6j3S WgsFw7ZXjuq5RYG8H5jOnTU/YRSyzsq4A0DGuW9OYla4V+aBkyesd8zOwQuEHAppgB+D IOhO3wa9VKYalXkK8T1LeSRw3PiPUOziJMNyZ9TuKF7NpfR7BrEtyz+sORe4gwTGEttf 8NuG177PLKS9+RluWblAmrKF0RAS1ZKyMHYWc+ezQQLRQl5xNH75+lO/Opiw0u60jLiI iz6Q== X-Received: by 10.68.137.234 with SMTP id ql10mr160508704pbb.158.1357296805031; Fri, 04 Jan 2013 02:53:25 -0800 (PST) Received: from localhost ([159.226.5.131]) by mx.google.com with ESMTPS id j8sm33011005paz.30.2013.01.04.02.53.22 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Jan 2013 02:53:24 -0800 (PST) From: ycnian@gmail.com To: bhalevy@tonian.com Cc: linux-nfs@vger.kernel.org, Yanchuan Nian Subject: [PATCH] pnfsd: Correct the buffer size of ds_list in dlm_device_entry Date: Fri, 4 Jan 2013 18:43:43 +0800 Message-Id: <1357296223-5796-1-git-send-email-ycnian@gmail.com> X-Mailer: git-send-email 1.7.4.4 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Yanchuan Nian In nfsd4_set_pnfs_dlm_device(), if there is a device with the same disk_name as the new device, pnfsd will clear the memory of ds_list, and then update it with ds list from the new device. The size of ds_list in struct dlm_device_entry is NFSD_DLM_DS_LIST_MAX, but not DISK_NAME_LEN. Signed-off-by: Yanchuan Nian --- fs/nfsd/nfs4pnfsdlm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/nfsd/nfs4pnfsdlm.c b/fs/nfsd/nfs4pnfsdlm.c index e8423e0..c138d41 100644 --- a/fs/nfsd/nfs4pnfsdlm.c +++ b/fs/nfsd/nfs4pnfsdlm.c @@ -187,7 +187,7 @@ nfsd4_set_pnfs_dlm_device(char *pnfs_dlm_device, int len) dprintk("%s pnfs_dlm_device %s:%s already in cache " " replace ds_list with new ds_list %s\n", __func__, found->disk_name, found->ds_list, new->ds_list); - memset(found->ds_list, 0, DISK_NAME_LEN); + memset(found->ds_list, 0, NFSD_DLM_DS_LIST_MAX); memcpy(found->ds_list, new->ds_list, strlen(new->ds_list)); found->num_ds = new->num_ds; kfree(new);