[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <208066d6326a428499fa68c5984da62c@aladdin.ru>
Date: Mon, 19 Feb 2024 15:07:59 +0000
From: Daniil Dulov <D.Dulov@...ddin.ru>
To: David Howells <dhowells@...hat.com>
CC: Jeffrey E Altman <jaltman@...istor.com>, "linux-afs@...ts.infradead.org"
<linux-afs@...ts.infradead.org>, Marc Dionne <marc.dionne@...istor.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"lvc-project@...uxtesting.org" <lvc-project@...uxtesting.org>
Subject: RE: [PATCH v2] afs: Increase buffer size in
afs_update_volume_status()
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@...hat.com]
Sent: Monday, February 19, 2024 1:34 PM
To: Daniil Dulov <D.Dulov@...ddin.ru>
Cc: dhowells@...hat.com; Jeffrey E Altman <jaltman@...istor.com>; linux-afs@...ts.infradead.org; Marc Dionne <marc.dionne@...istor.com>; linux-kernel@...r.kernel.org; lvc-project@...uxtesting.org
Subject: Re: [PATCH v2] afs: Increase buffer size in afs_update_volume_status()
I suggest the attached instead.
David
---
diff --git a/fs/afs/volume.c b/fs/afs/volume.c index 020ecd45e476..af3a3f57c1b3 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;
_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 = sprintf(idbuf, "%llu", volume->vid);
+ idsz = snprintf(idbuf, sizeof(idbuf), "%llu", volume->vid);
vldb = afs_vl_lookup_vldb(volume->cell, key, idbuf, idsz);
if (IS_ERR(vldb)) {
Powered by blists - more mailing lists