Re: [PATCH] ceph: uninitialized variable in debug output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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@xxxxxxxxxx>
---
  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@xxxxxxxxxx>




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux