Skip to contentSkip to conversation

ceph: do_sync is never initialized

PATCH Applied Dan Carpenter 2 participants 2 messages Nov 28, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: do_sync is never initialized

Probably this code was syncing a lot more often then intended because the do_sync variable wasn't set to zero.

Fixes c62988ec0910 ('ceph: avoid meaningless calling ceph_caps_revoking if sync_mode == WB_SYNC_ALL.')

---
Static checker stuff. Not tested. It's surprising that GCC doesn't catch this.

fs/ceph/addr.c +1 -1
index 18c06bb..481529b 100644
@@ -673,7 +673,7 @@ static int ceph_writepages_start(struct address_space *mapping,
 	int rc = 0;
 	unsigned wsize = 1 << inode->i_blkbits;
 	struct ceph_osd_request *req = NULL;
-	int do_sync;
+	int do_sync = 0;
 	u64 truncate_size, snap_size;
 	u32 truncate_seq;
 
Applied
#1 lore raw
Quoted 14 lines · Dan Carpenter

Probably this code was syncing a lot more often then intended because the do_sync variable wasn't set to zero.

Fixes c62988ec0910 ('ceph: avoid meaningless calling ceph_caps_revoking if sync_mode == WB_SYNC_ALL.')

---
Static checker stuff. Not tested. It's surprising that GCC doesn't catch this.

fs/ceph/addr.c +0 -0
index 18c06bb..481529b 100644

fs/ceph/addr.c static int ceph_writepages_start(struct address_space *mapping, · line 678

Quoted 7 lines
fs/ceph/addr.c +1 -1
@@ -673,7 +673,7 @@ static int ceph_writepages_start(struct address_space *mapping,
        int rc = 0;
        unsigned wsize = 1 << inode->i_blkbits;
        struct ceph_osd_request *req = NULL;
-       int do_sync;
+       int do_sync = 0;
        u64 truncate_size, snap_size;
        u32 truncate_seq;

Applied, also added a stable tag for 3.11+.

Thanks,

Ilya

Quoted 5 lines
fs/ceph/addr.c +0 -1
--

To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html