* [PATCH] ceph: uninitialized variable in debug output
@ 2022-03-07 14:21 Dan Carpenter
2022-03-08 0:11 ` Xiubo Li
2022-03-08 9:36 ` David Howells
0 siblings, 2 replies; 6+ messages in thread
From: Dan Carpenter @ 2022-03-07 14:21 UTC (permalink / raw)
To: Jeff Layton, David Howells
Cc: Xiubo Li, Ilya Dryomov, ceph-devel, kernel-janitors
If read_mapping_folio() fails then "inline_version" is printed without
being initialized.
Fixes: 083db6fd3e73 ("ceph: uninline the data on a file opened for writing")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
fs/ceph/addr.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 3c1257b09775..0d4120297ede 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -1632,9 +1632,10 @@ int ceph_uninline_data(struct file *file)
struct ceph_osd_request *req;
struct ceph_cap_flush *prealloc_cf;
struct folio *folio = NULL;
+ u64 inline_version = -1;
struct page *pages[1];
- u64 len, inline_version;
int err = 0;
+ u64 len;
prealloc_cf = ceph_alloc_cap_flush();
if (!prealloc_cf)
--
2.20.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] ceph: uninitialized variable in debug output
2022-03-07 14:21 [PATCH] ceph: uninitialized variable in debug output Dan Carpenter
@ 2022-03-08 0:11 ` Xiubo Li
2022-03-08 9:36 ` David Howells
1 sibling, 0 replies; 6+ messages in thread
From: Xiubo Li @ 2022-03-08 0:11 UTC (permalink / raw)
To: Dan Carpenter, Jeff Layton, David Howells
Cc: Ilya Dryomov, ceph-devel, kernel-janitors
On 3/7/22 10:21 PM, Dan Carpenter wrote:
> If read_mapping_folio() fails then "inline_version" is printed without
> being initialized.
>
> Fixes: 083db6fd3e73 ("ceph: uninline the data on a file opened for writing")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> fs/ceph/addr.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
> index 3c1257b09775..0d4120297ede 100644
> --- a/fs/ceph/addr.c
> +++ b/fs/ceph/addr.c
> @@ -1632,9 +1632,10 @@ int ceph_uninline_data(struct file *file)
> struct ceph_osd_request *req;
> struct ceph_cap_flush *prealloc_cf;
> struct folio *folio = NULL;
> + u64 inline_version = -1;
> struct page *pages[1];
> - u64 len, inline_version;
> int err = 0;
> + u64 len;
>
> prealloc_cf = ceph_alloc_cap_flush();
> if (!prealloc_cf)
Possibly we'd better format the 'inline_version' in hexadecimal ?
Reviewed-by: Xiubo Li<xiubli@redhat.com>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] ceph: uninitialized variable in debug output
2022-03-07 14:21 [PATCH] ceph: uninitialized variable in debug output Dan Carpenter
2022-03-08 0:11 ` Xiubo Li
@ 2022-03-08 9:36 ` David Howells
2022-03-08 13:24 ` Jeff Layton
1 sibling, 1 reply; 6+ messages in thread
From: David Howells @ 2022-03-08 9:36 UTC (permalink / raw)
To: Dan Carpenter
Cc: dhowells, Jeff Layton, Xiubo Li, Ilya Dryomov, ceph-devel,
kernel-janitors
Dan Carpenter <dan.carpenter@oracle.com> wrote:
> + u64 inline_version = -1;
ULLONG_MAX?
David
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ceph: uninitialized variable in debug output
2022-03-08 9:36 ` David Howells
@ 2022-03-08 13:24 ` Jeff Layton
2022-03-08 13:28 ` Jeff Layton
0 siblings, 1 reply; 6+ messages in thread
From: Jeff Layton @ 2022-03-08 13:24 UTC (permalink / raw)
To: David Howells, Dan Carpenter
Cc: Xiubo Li, Ilya Dryomov, ceph-devel, kernel-janitors
On Tue, 2022-03-08 at 09:36 +0000, David Howells wrote:
> Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> > + u64 inline_version = -1;
>
> ULLONG_MAX?
>
> David
>
...or maybe CEPH_INLINE_NONE, which is:
#define CEPH_INLINE_NONE ((__u64)-1)
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] ceph: uninitialized variable in debug output
2022-03-08 13:24 ` Jeff Layton
@ 2022-03-08 13:28 ` Jeff Layton
2022-03-08 13:30 ` Dan Carpenter
0 siblings, 1 reply; 6+ messages in thread
From: Jeff Layton @ 2022-03-08 13:28 UTC (permalink / raw)
To: David Howells, Dan Carpenter
Cc: Xiubo Li, Ilya Dryomov, ceph-devel, kernel-janitors
On Tue, 2022-03-08 at 08:24 -0500, Jeff Layton wrote:
> On Tue, 2022-03-08 at 09:36 +0000, David Howells wrote:
> > Dan Carpenter <dan.carpenter@oracle.com> wrote:
> >
> > > + u64 inline_version = -1;
> >
> > ULLONG_MAX?
> >
> > David
> >
>
> ...or maybe CEPH_INLINE_NONE, which is:
>
> #define CEPH_INLINE_NONE ((__u64)-1)
>
I went ahead and merged the patch into our testing branch, with the
change to use CEPH_INLINE_NONE instead.
Thanks!
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] ceph: uninitialized variable in debug output
2022-03-08 13:28 ` Jeff Layton
@ 2022-03-08 13:30 ` Dan Carpenter
0 siblings, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2022-03-08 13:30 UTC (permalink / raw)
To: Jeff Layton
Cc: David Howells, Xiubo Li, Ilya Dryomov, ceph-devel,
kernel-janitors
On Tue, Mar 08, 2022 at 08:28:21AM -0500, Jeff Layton wrote:
> On Tue, 2022-03-08 at 08:24 -0500, Jeff Layton wrote:
> > On Tue, 2022-03-08 at 09:36 +0000, David Howells wrote:
> > > Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > >
> > > > + u64 inline_version = -1;
> > >
> > > ULLONG_MAX?
> > >
> > > David
> > >
> >
> > ...or maybe CEPH_INLINE_NONE, which is:
> >
> > #define CEPH_INLINE_NONE ((__u64)-1)
> >
>
> I went ahead and merged the patch into our testing branch, with the
> change to use CEPH_INLINE_NONE instead.
I liked CEPH_INLINE_NONE so I was resending it right now... But thanks!
regards,
dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-03-08 13:31 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-07 14:21 [PATCH] ceph: uninitialized variable in debug output Dan Carpenter
2022-03-08 0:11 ` Xiubo Li
2022-03-08 9:36 ` David Howells
2022-03-08 13:24 ` Jeff Layton
2022-03-08 13:28 ` Jeff Layton
2022-03-08 13:30 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox