diff mbox

ceph: do_sync is never initialized

Message ID 20141128083334.GB10252@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Nov. 28, 2014, 8:33 a.m. UTC
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.')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Static checker stuff.  Not tested.  It's surprising that GCC doesn't
catch this.

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

Comments

Ilya Dryomov Nov. 28, 2014, 5:25 p.m. UTC | #1
On Fri, Nov 28, 2014 at 11:33 AM, Dan Carpenter
<dan.carpenter@oracle.com> wrote:
> 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.')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Static checker stuff.  Not tested.  It's surprising that GCC doesn't
> catch this.
>
> diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
> index 18c06bb..481529b 100644
> --- a/fs/ceph/addr.c
> +++ b/fs/ceph/addr.c
> @@ -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
>
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 18c06bb..481529b 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -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;