Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1194361rdb; Mon, 19 Feb 2024 07:13:23 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWvGYqAMXq/hKOOXEC1aLSKYPRjUSfnJqJPVP2JfTR0UP86ormkccRyE/I+PG9ivb1xeRL+ABBURSNuQoK5pR2rUSutXz+wAiqC4KUMnw== X-Google-Smtp-Source: AGHT+IHCsKISxeWlaMIOKqVslJimzKJCLYK/BsMJcdh9qyP/gaArK4R3CPYdKZxrd9e5x24t0nI/ X-Received: by 2002:a17:902:8c98:b0:1db:5468:20d9 with SMTP id t24-20020a1709028c9800b001db546820d9mr10393093plo.44.1708355602906; Mon, 19 Feb 2024 07:13:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708355602; cv=pass; d=google.com; s=arc-20160816; b=PqMJD86by7amPPoc7xVhWSAi6hxAPE2vDwfOnMGPfKlCsa3fjxQt4qcnJdvP/EFI/A quWVB7RWZUmY4q7Hbd/o+VGw+W5KijYuErQA42TPVIWEuhCSUQia/KT+uum3Mx4IrFE/ iYG3NAgrRMYPNDg254AbcIVIeZQceBB8PgfoOXzQySutInCqLnp5wNrjxT9KDASbYFcX 7ni/mrPzwidqgcYm69ErBK/ksUvFvBh1vbKTzOxkjLodBVi1pm7Ez0avlk1ZawnFmbnj WG9SzdJ57ScG8w1ksebydO1CMHgdluouoReD7OB2bHtE7HcqdKTS/hYAdLviX0Tw7iG5 Rbdg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:content-language:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from; bh=xHhZEYrr0qSOuXhd9j+VU9qpLI0j3sl2Ej5XvC+dz+M=; fh=ghw1WDz/XVOy7jpjyjOAdUTy7ovl5bUl5Css4UB124s=; b=MfKZW9W1250+UOlS1xJQdJPch8KsVLxvlM6W2gzzKIdw1xDiiVJZ+DOkpp067pm1IJ yj0EB/pkhe4ZyOtK/oQGDn1w0FhjLwJ4aj7scIyG0J+I4vQVTDC5GUUTlHwb/fjVW2lT 1KK/mrUwTJ9anWYj/2+KDhc0rJbdV+4shlnhZ8rXBdrbgGCmXZ6AkkDTxIlhpjDsyjnA mhsfrrOPBgNkb0jGZdsUFj/DaE8Jp4BTukzg7QK0s3Cl29bNSI7oc8xPLSEHIlmJPe7H zGdzkEpG9gtnwH4dWYBA7Dk7JCRhpsl9C/0i1rR0OXpX3kxSyGDo7MvRLKdmX3tjPnqC BDOA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=aladdin.ru dmarc=pass fromdomain=aladdin.ru); spf=pass (google.com: domain of linux-kernel+bounces-71564-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71564-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aladdin.ru Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id b17-20020a170902e95100b001d95ef48eddsi4475624pll.312.2024.02.19.07.13.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 07:13:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71564-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=aladdin.ru dmarc=pass fromdomain=aladdin.ru); spf=pass (google.com: domain of linux-kernel+bounces-71564-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71564-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aladdin.ru Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9ABE42820ED for ; Mon, 19 Feb 2024 15:13:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3317C381CB; Mon, 19 Feb 2024 15:13:19 +0000 (UTC) Received: from mail-out.aladdin-rd.ru (mail-out.aladdin-rd.ru [91.199.251.16]) (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 104EF1EA71 for ; Mon, 19 Feb 2024 15:13:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.199.251.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708355598; cv=none; b=DMNzdctjgNHWIdDtOzynbI/H7h2dmRImU5RYZ2v8HZlx6T2oyvbkJYdDLGBfbWa3Nuh31NvbefBhVsMirodd/JUWrbacyM1lughBB04NTVgByryhfFMn3Aro5SqFZB7Sv0uAJEyqk81+oedeDakIH1yHxmajHmMGkR+mHHRQs88= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708355598; c=relaxed/simple; bh=TVSESAyFaGTL23/oyX3q2EZFs2U2rQaW2gTJ4oRS36A=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=VkBhj9+ctzH0a3ngOhF+ulGujE2kG41EzAoy8tgFhRIVRtPb7x8zrhjafn6jNqbiQgIeG2F7VS0k+0YB4fmROVs8RA4vXgcviHzZZPPnrtpoTN63tQ27J1j0OP5YuTZ7AXzlwY2FiQyPl8LCVBcRWenkvOxDtwDAUClYoZTmdqo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=aladdin.ru; spf=pass smtp.mailfrom=aladdin.ru; arc=none smtp.client-ip=91.199.251.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=aladdin.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aladdin.ru From: Daniil Dulov To: David Howells CC: Jeffrey E Altman , "linux-afs@lists.infradead.org" , Marc Dionne , "linux-kernel@vger.kernel.org" , "lvc-project@linuxtesting.org" Subject: RE: [PATCH v2] afs: Increase buffer size in afs_update_volume_status() Thread-Topic: [PATCH v2] afs: Increase buffer size in afs_update_volume_status() Thread-Index: AQHaXY42ktMjs5Z/0kKi/kDcfp2GrLERUMYAgABCobA= Date: Mon, 19 Feb 2024 15:07:59 +0000 Message-ID: <208066d6326a428499fa68c5984da62c@aladdin.ru> References: <20240212083347.10742-1-d.dulov@aladdin.ru> <125563.1708338814@warthog.procyon.org.uk> In-Reply-To: <125563.1708338814@warthog.procyon.org.uk> Accept-Language: ru-RU, en-US Content-Language: ru-RU X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Hello! Thank you for your feedback. I agree with the suggested improvement. I will= send v3 a bit later today. -----Original Message----- From: David Howells [mailto:dhowells@redhat.com]=20 Sent: Monday, February 19, 2024 1:34 PM To: Daniil Dulov Cc: dhowells@redhat.com; Jeffrey E Altman ; linux-afs= @lists.infradead.org; Marc Dionne ; linux-kernel@= vger.kernel.org; lvc-project@linuxtesting.org Subject: Re: [PATCH v2] afs: Increase buffer size in afs_update_volume_stat= us() I suggest the attached instead. David --- diff --git a/fs/afs/volume.c b/fs/afs/volume.c index 020ecd45e476..af3a3f57= c1b3 100644 --- a/fs/afs/volume.c +++ b/fs/afs/volume.c @@ -353,7 +353,7 @@ static int afs_update_volume_status(struct afs_volume *= volume, struct key *key) { struct afs_server_list *new, *old, *discard; struct afs_vldb_entry *vldb; - char idbuf[16]; + char idbuf[24]; int ret, idsz; =20 _enter(""); @@ -361,7 +361,7 @@ static int afs_update_volume_status(struct afs_volume *= volume, struct key *key) /* We look up an ID by passing it as a decimal string in the * operation's name parameter. */ - idsz =3D sprintf(idbuf, "%llu", volume->vid); + idsz =3D snprintf(idbuf, sizeof(idbuf), "%llu", volume->vid); =20 vldb =3D afs_vl_lookup_vldb(volume->cell, key, idbuf, idsz); if (IS_ERR(vldb)) {