]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
libceph: don't clear bio_iter in prepare_write_message()
authorAlex Elder <elder@inktank.com>
Thu, 7 Mar 2013 05:39:39 +0000 (23:39 -0600)
committerGreg Farnum <greg@inktank.com>
Wed, 13 Mar 2013 00:45:12 +0000 (17:45 -0700)
commita9294c10a682396e2ccfd6912280d924ea3e24fa
tree86bf66f9582d3d9615bf0e021d78838e33d05c54
parentc2523fad93715979cb4e86a9e1c167fa4767561c
libceph: don't clear bio_iter in prepare_write_message()

At one time it was necessary to clear a message's bio_iter field to
avoid a bad pointer dereference in write_partial_msg_pages().

That no longer seems to be the case.  Here's why.

The message's bio fields represent (in this case) outgoing data.
Between where the bio_iter is made NULL in prepare_write_message()
and the call in that function to prepare_message_data(), the
bio fields are never used.

In prepare_message_data(), init-bio_iter() is called, and the result
of that overwrites the value in the message's bio_iter field.

Because it gets overwritten anyway, there is no need to set it to
NULL.  So don't do it.

This resolves:
    http://tracker.ceph.com/issues/4402

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
net/ceph/messenger.c