commit 5b1ed3b29284f39dea6ce4a329d41ce92a66f9cb
Author: Tomas Bzatek <tbzatek@redhat.com>
Date:   2013-05-14

    Update NEWS for 1.16.2 release

M	NEWS

commit 60f04600f58a7f4d1779f369f9cb97059fe18441
Author: Tomas Bzatek <tbzatek@redhat.com>
Date:	2013-05-13

    metadata: Flush all scheduled writeouts on daemon exit

    This patch ensures that we safely write all data from journals to
    metatrees on exit. E.g. if anything happens to session bus or we get
    replaced by some other instance.

    https://bugzilla.gnome.org/show_bug.cgi?id=637095
    (cherry picked from commit e793a0476feeaa0a3cc4f1fd043c15c297707455)

M	metadata/meta-daemon.c

commit 755ed5e229f02429838af1b8b84a922ef3efd2f0
Author: Tomas Bzatek <tbzatek@redhat.com>
Date:	2013-05-13

    metadata: Use shorter writeout timeout on NFS

    Since we've moved journal to a non-volatile storage, let's flush
    more often to minimize a chance of data loss.

    https://bugzilla.gnome.org/show_bug.cgi?id=637095
    (cherry picked from commit c8e7d1375715545f28a0943ce7657330e3b70acd)

M	metadata/meta-daemon.c
M	metadata/metatree.c
M	metadata/metatree.h

commit 34db4bdf35935b153da26bf8d0654242a6c6da9c
Author: Tomas Bzatek <tbzatek@redhat.com>
Date:	2013-05-13

    metadata: Put journal in $XDG_RUNTIME_DIR for shared NFS homedir case

    This essentially moves is_on_nfs() from metatree.c in metabuilder.c
    as the more appropriate place for shared functions. It's used in
    meta_builder_get_journal_filename() to determine whether to use
    original
    metadata directory or temporary $XDG_RUNTIME_DIR location to work
    around
    certain NFS issues.

    The idea behind this change is to have separate journals for every
    client
    that is accessing shared homedir. Then the only possible point
    of conflict
    is on rotation which is backed up by atomic file rename. Without this,
    there were multiple metadata daemons writing to the same journal file,
    overwriting changes to each other and being racy in flush and
    rotation.

    There will always be a conflict between clients, overwriting tree file
    data by flushing their journals.

    https://bugzilla.gnome.org/show_bug.cgi?id=637095
    (cherry picked from commit 749c872b9192a84e65d83bc0f0eb697ab247fdd8)

M	metadata/metabuilder.c
M	metadata/metabuilder.h
M	metadata/metatree.c

commit c7274dfaff4a3be413404fbdeeab11aa8bdb35f6
Author: Tomas Bzatek <tbzatek@redhat.com>
Date:	2013-05-13

    metadata: Create new journal if it doesn't exist

    With concurrent access of multiple daemons there may be a moment when
    tree file exists but not the journal file. The daemon can't write
    anything without journal and is doomed until next rotation. Missing
    journal file can also happen on system crash etc.

    This patch tries to create new journal file only when it doesn't
    exist,
    other errors still lead to inability to store anything.

    This will also allow us to have journal file somewhere else, e.g. on
    a non-persistent storage.

    https://bugzilla.gnome.org/show_bug.cgi?id=637095
    (cherry picked from commit 3381859ba7a92f4824ff09a7aa951407bf4e1c72)

M	metadata/metabuilder.c
M	metadata/metabuilder.h
M	metadata/metatree.c

commit 496efc06171967aff217670d07d0cb6c4ccc62bf
Author: Tomas Bzatek <tbzatek@redhat.com>
Date:	2013-05-13

    metadata: Be more resistive to broken journal files

    In shared NFS homedir case with multiple clients writing to the same
    mmaped journal file data can get easily corrupted. The daemon iterates
    over a journal file on flush taking in account variable entry size and
    advances according to the data read.

    However in certain case invalid data are read making us to jump out of
    bounds. In case of zero entry size we would stand at the same place
    leading to infinite loop.

    This patch checks if the indicated entry size is at least the size of
    the structure we're getting the size from (it's a first element)
    and breaks
    the iteration cycle if it's not. This may lead to partial data loss
    on flush
    as we don't process the rest of the journal file. Old data from
    existing
    tree file will be preserved of course, only few recent changes would
    get lost.

    https://bugzilla.gnome.org/show_bug.cgi?id=637095
    (cherry picked from commit 21811b3ae17ec705327484c1ce0be75fec95bb0e)

M	metadata/metatree.c

commit 39f7b6ffd306943005413deb25bee6a56cb5e6f9
Author: Tomas Bzatek <tbzatek@redhat.com>
Date:	2013-05-13

    metadata: Force tree re-read after successful flush

    Once we flush the journal and write new tree file we need to re-read
    it to refresh internal data structures (and mmap data from the right
    file). We originally left this work on meta_tree_refresh_locked() and
    meta_tree_needs_rereading() respectively where we checked the rotated
    bit.

    In detail, metabuilder wrote a new temp tree file, then explicitly
    opened
    the current (old) one, wrote the rotated bit and atomically
    replaced the
    temp file. Then the metadata daemon having mmapped the old file
    detected
    the rotated bit and scheduled journal and tree file reopen+reread.

    However in concurrent environment like NFS homedir where multiple
    metadata
    daemons are handling the same database we may run in a race and
    not getting
    the rotated bit detected properly.

    This led to an infinite loop between meta_journal_add_entry() -
    meta_tree_flush_locked() - meta_tree_refresh_locked() -
    meta_journal_add_entry()
    since we had full journal, didn't detect the rotation and since
    the files
    were already unlinked, there was no force to break that loop. This
    patch
    forces tree file re-read after successful flush to prevent this issue.

    https://bugzilla.gnome.org/show_bug.cgi?id=637095
    (cherry picked from commit 6b12c3d7b33c87a7fea228106f39ecf2a3e0f310)

M	metadata/metatree.c

commit 473cd1356403c28b83347b1a62ec17a2198288d6
Author: Philip Langdale <philipl@overt.org>
Date:	2013-04-17

    MTP: Use actual standard name for SD Card icon.

    The last name I chose was deprecated. What fun.

    https://bugzilla.gnome.org/show_bug.cgi?id=698174

M	daemon/gvfsbackendmtp.c

commit 9102e80796a7f424eb4fd7e1a6f69721218c8bfb
Author: Philip Langdale <philipl@overt.org>
Date:	2013-04-16

    MTP: Use standard name for SD Card icon.

    I was previously using an Ubuntu specific alias.

    https://bugzilla.gnome.org/show_bug.cgi?id=698174

M	daemon/gvfsbackendmtp.c

commit ffbcd870b6297ccaabfc50b9dc47f51d9ea7905d
Author: Tomas Bzatek <tbzatek@redhat.com>
Date:	2013-04-16

    Post release version bump

M	configure.ac