From owner-freebsd-fs@FreeBSD.ORG Mon Jul 12 20:37:17 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22FF11065677 for ; Mon, 12 Jul 2010 20:37:17 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9CE2D8FC15 for ; Mon, 12 Jul 2010 20:37:16 +0000 (UTC) Received: by bwz12 with SMTP id 12so3160487bwz.13 for ; Mon, 12 Jul 2010 13:37:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=Lunt+DetAzBOeujn+q36ZNfIghBFZie85Hi9xLvrfFc=; b=MhzdDdpx8Q+CyUryhS+nUBK8rRNkTdEyhAEQEJKYV5cS8Podj/tHiTQnB20nI4hHBE myJ9sT2SPYAsNpMEBDcxApFbMgfLvTrtSloUOavblxYSZxND6IORTGeUisqKHs4hv62u gDFsP/GsTvtJ/pFsH2D+NIog6NYuyMpw4p8xk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=OZCrH7JPQA72pJ5FADvDmMKUnB3uehgYdm1UpWk3SKLwNzHc0Q83bL1oGx3gmFuehy uefq/sSR72f5ZjOdiwN9AZ5rByRfcIpUIfc124aXiDUqzYHvG6mf2pT4oA4dTRpfaw2+ MjcBME2Ag/VkdnD9fr/Z243m1yQej5nDL+MDc= Received: by 10.204.82.130 with SMTP id b2mr10867302bkl.12.1278967035351; Mon, 12 Jul 2010 13:37:15 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id f10sm20109402bkl.17.2010.07.12.13.37.13 (version=SSLv3 cipher=RC4-MD5); Mon, 12 Jul 2010 13:37:14 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C3B7CF7.6090308@FreeBSD.org> Date: Mon, 12 Jul 2010 23:37:11 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: Mikolaj Golub References: <4C3B75A1.4020905@FreeBSD.org> <86lj9gbftt.fsf@kopusha.home.net> In-Reply-To: <86lj9gbftt.fsf@kopusha.home.net> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-fs@freebsd.org Subject: Re: ata-disk.c:ad_init(): max_iosize might be uninitialized? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jul 2010 20:37:17 -0000 Mikolaj Golub wrote: > On Mon, 12 Jul 2010 23:05:53 +0300 Alexander Motin wrote: > > AM> Hi. > > AM> Mikolaj Golub wrote: > >> It might be a wrong list but I have not found freebsd-ata@ or freebsd-disk@ > >> list -). > >> > >> I just have looked accidentally at ad_init() in dev/ata/ata-disk.c and it > >> looks like there is at least theoretical possibility that atadev->max_iosize > >> remains uninitialized (if ata_controlcmd(ATA_SET_MULTI) fails). Shouldn't be > >> like in the patch below? > > AM> It is not very obvious, but it is initialized in ata_add_child(). > > Ah, I see. Thank you :-). But then "else atadev->max_iosize = DEV_BSIZE;" part > in ad_init() looks like unnecessary and rather confusing (it suggests that > max_iosize is initialized by this funtion. Probably so. And thinking a bit more I've got to idea that you were not completely wrong initially. If device was reset after initial probe and then reinitialization failed, atadev->max_iosize probably should be reduced to stay on safe side. -- Alexander Motin