From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C890386540 for ; Mon, 6 Apr 2026 15:12:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775488347; cv=none; b=Y4utbN7evqQaocFlUJv9jKcrD1IOIPsqZ9ipzfpn911UT8bqfn/V6q+jtUGsfIvOgRur9nZSGx/nme/wyN7Oxj27RwKjBPbRQNOZ4PTawXhGekriju+hiVrPJNIEbVsTrGWYUau+/6SwFjTZT3RwoSO8BjCGJzVRWAQoo42XdcM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775488347; c=relaxed/simple; bh=kL2UUJut3o2fJHUs42ZXQvrQBJ96z8HhGrH22QxSwMI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DyEF99vFiPiIDFS2DD4Ht9dTtHC0daaI+zvwSm/u7etNqzUROlt4Q6p5Tfh/nDyDzMuHTkINakskUUSY8XyzAYGAy/+XM0DSxTIXLfdIC0ZnqDusC4QjlQHmYHLpfLMmNdKlNd5KZUY8dtWS1QQK734uWgBpYmwa7utMjjJE7HU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WB6anKlO; arc=none smtp.client-ip=209.85.221.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WB6anKlO" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-43cfbd17589so3147663f8f.0 for ; Mon, 06 Apr 2026 08:12:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775488344; x=1776093144; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=UWT2jl1YmBSLjzDccsR3uGh5qIBOeSHKTstBptqLJ2M=; b=WB6anKlOIxrJiVO7yWAgaV2/Woj5KsGtbZWCep+02RN1eFdG9YPdd1EztHWm9MVCf6 4VxuqF1muMLmE330A1yWJ6mezdOpE03MYwrji1dRDMhr/bT7pqzAfToRm/7gHYl7IPfg Cgeqt1AkgV5jK4m1rxu5zzGpGh+iUZg6AYsWygysnEOeLUY3BLW9wZPj1vQmfg05Xxj2 UmN0vqrCTlwSeFZ7AGdJsLq+RYewOCzkKp/C8LEDtlkZ8X8F3EDklhTjtAeGh33vipRO /8IeCP7nlwARpqYKAAXtob+gboRu8uPvwaOfAV0yE46IoAcvFhGooERAugpvBZ6+Vp1h YJHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775488344; x=1776093144; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UWT2jl1YmBSLjzDccsR3uGh5qIBOeSHKTstBptqLJ2M=; b=jhRtfFtJcVKfi31GITextFsyMT5N6l1lwIVXLf9SeO8NwzgOUcgsacPh61K2lu1bFY CImaxMAQw6a+EnegP95Qf9IxfZNB0A3vbyMJynrIfI70V4jmo8BeSrj7wzTz6v12AwNK J37ZHakr1pRZtRqiqhXi9Q7u4By2RYpBIZ1qcTiUf35No2w5+XPiR0MJCyYGUIV3mjCK yikKeckRa3uZp68oMrquDewvnMxJ0HAi4igAFgd0TKf3xN4+EgsmC9eMRX7RGB5GKjPc ifx0IAwSAZKlFGga/U5S6HRc9K4arhnaVRY3ohmorlFUwB7pYWjVkjiQwO1ZIQHi0G2m xgUA== X-Forwarded-Encrypted: i=1; AJvYcCV0tjAn2gwYDuKU57ozBaxxnTCwIz5BdoOu5YzavEbRswXCtkL9p+Yi51dS+dwetXeHPDL6e35yYIkDhAc=@vger.kernel.org X-Gm-Message-State: AOJu0YwgOT2jR+KtuF8BHVVTaWOnRHGR+2fXYLH2JwPa5BjGUc8TCgb8 uuDsxNxsYZPdPD5UFBRNTTgGQTBamw/FNC5TJRc9M/N/isJ4+pNpINs= X-Gm-Gg: AeBDieuvhFNKFfluDusyoTTrQ/waX8tRTgYcJqsWQOFKyHmuvpIa2KJMQBhG8IBimvv ovBLIpCTP1yV48Zmdx5dMHaduGeLbeqyuG80b5WynfUxRmi6IDjiPTS2/7O041VjKn0lOdnRgNr FJJoayXi2m80qUa8LUls6636IAIUXW6KtCDqA9a435rCOmIDDsd09idnlUP9Evcs6+LnDo2ous2 ytBPWnPSICV/aw0hB5F8W09H5EWVGum7Lg8cpzrpWXJcFe9fq4zp1o1jhx2lSlon8FpHTAbshBq VqZsXXLreI3Ab5qb4kGdwkHF5PyQn15YdtBhEs3wn4P9PbtxRNlciH30MW1BWcCWJS/5AvHXLWw JLp1ykQpm8RwyMMNx7JM2Vk8vG8lSvIGH5uUzqtUd3zonGoEotWi21Cn0Tah2ESlaS6/yqHBMlm nZahCP00lefYwJ3e4yGvvZ4mmhtUv6w07OZ8LSVmg681vGqf+3rmBcqMgSxLV+knqahCH4fpOc7 qXX X-Received: by 2002:a05:6000:25c6:b0:43c:f719:a7f0 with SMTP id ffacd0b85a97d-43d2929467bmr19694461f8f.12.1775488344368; Mon, 06 Apr 2026 08:12:24 -0700 (PDT) Received: from lithos ([2a02:810d:4a94:b300:aeeb:3bab:9e78:12a6]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43d1e4f5294sm38945048f8f.35.2026.04.06.08.12.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Apr 2026 08:12:23 -0700 (PDT) Date: Mon, 6 Apr 2026 17:12:18 +0200 From: Florian Fuchs To: Adrian McMenamin Cc: linux-sh@vger.kernel.org, John Paul Adrian Glaubitz , Artur Rojek , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] cdrom: gdrom: update gendisk capacity on open Message-ID: References: <20260405082330.4104672-1-fuchsfl@gmail.com> <20260405082330.4104672-3-fuchsfl@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On 06 Apr 11:21, Adrian McMenamin wrote: > On Mon, 6 Apr 2026 at 11:00, Adrian McMenamin wrote: > > > > Florian, > > > > On Mon, 6 Apr 2026 at 10:20, Florian Fuchs wrote: > > > > > > > > > > You mean, because one of the functions in the call tree of > > > gdrom_update_capacity() wants to get the mutex gdrom_mutex or s_umount? > > > I checked the locally called functions, but don't see that one tries to > > > aquire a lock. > > > > > > I don't understand the exact potential of the race condition, maybe you > > > can elaborate, where I should look. > > > > > > > > > Actually, having looked at the code path in detail too I agree that > > this won't recreate the problem the earlier patch addressed, so this > > looks good to me. > > > Sorry - a further thought. This rechecking for capacity is only truly > necessary if there has been a change of medium - is that right? So we > can take the result of the earlier disk_check_media_change and if that > returns true update the capacity? Is that not correct? The problem is, that disk_check_media_change(disk) is false on initial gdrom_bdops_open() when the CD is already in it. It gets true there, if I swap the disc while running the DC. So right now, it would check capacity on every gdrom_bdops_open() - which is mostly on every mount, instead of only if the disk was really changed in between two mounts. Regards Florian