ceph: uninitialized variable in debug output
Subsystems (2)
PATCH 1/1 ceph: uninitialized variable in debug output
If read_mapping_folio() fails then "inline_version" is printed without being initialized.
--- fs/ceph/addr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/ceph/addr.c +2 -1
@@ -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)
Signature · 1 line
2.20.1
Quoted 15 lines · Dan Carpenter
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 <[email protected]>--- fs/ceph/addr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)fs/ceph/addr.c +0
-0@@ -1632,9 +1632,10 @@ int ceph_uninline_data(struct file *file)struct ceph_osd_request *req;
fs/ceph/addr.c int ceph_uninline_data(struct file *file) · line 1641
Quoted 10 lines
fs/ceph/addr.c +2
-1struct 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 ?
fs/ceph/addr.c int ceph_uninline_data(struct file *file) · line 1635
Quoted 1 line · Dan Carpenter
fs/ceph/addr.c +1
-0+u64 inline_version =-1 ;
ULLONG_MAX?
David
Quoted 8 lines · David Howells
fs/ceph/addr.c int ceph_uninline_data(struct file *file) · line 1635
Quoted 1 line · Dan Carpenter
fs/ceph/addr.c +1
-0+u64 inline_version =-1 ;
ULLONG_MAX?David
...or maybe CEPH_INLINE_NONE, which is:
#define CEPH_INLINE_NONE ((__u64)-1)
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 7 lines · Jeff Layton
Quoted 6 lines · David Howells
fs/ceph/addr.c int ceph_uninline_data(struct file *file) · line 1635
Quoted 1 line · Dan Carpenter
fs/ceph/addr.c +1
-0+u64 inline_version =-1 ;
ULLONG_MAX?
Quoted 7 lines
Quoted 2 lines
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!
Signature · 1 line
Jeff Layton <[email protected]>
Quoted 11 lines · Jeff Layton
Quoted 10 lines · Jeff Layton
Quoted 8 lines · David Howells
fs/ceph/addr.c int ceph_uninline_data(struct file *file) · line 1635
Quoted 1 line · Dan Carpenter
fs/ceph/addr.c +1
-0+u64 inline_version =-1 ;
ULLONG_MAX?David
Quoted 7 lines
Quoted 4 lines
...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_NONEinstead.
I liked CEPH_INLINE_NONE so I was resending it right now... But thanks!
regards,
dan carpenter