]> git.baikalelectronics.ru Git - kernel.git/commit
ceph: do not modify fi->frag in need_reset_readdir()
authorNicolas Iooss <nicolas.iooss_linux@m4x.org>
Sun, 28 Aug 2016 16:47:12 +0000 (18:47 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 5 Sep 2016 12:30:35 +0000 (14:30 +0200)
commit84f6af0ef34a24d8e17d3c9e4a190157b39889dd
treeb57ebe5ded4d28dd333881950dc29a9e5326e3aa
parent2719bb922019299aaf3880c72f3e26ccdc92175f
ceph: do not modify fi->frag in need_reset_readdir()

Commit f93494b818bd ("ceph: using hash value to compose dentry offset")
modified "if (fpos_frag(new_pos) != fi->frag)" to "if (fi->frag |=
fpos_frag(new_pos))" in need_reset_readdir(), thus replacing a
comparison operator with an assignment one.

This looks like a typo which is reported by clang when building the
kernel with some warning flags:

    fs/ceph/dir.c:600:22: error: using the result of an assignment as a
    condition without parentheses [-Werror,-Wparentheses]
            } else if (fi->frag |= fpos_frag(new_pos)) {
                       ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
    fs/ceph/dir.c:600:22: note: place parentheses around the assignment
    to silence this warning
            } else if (fi->frag |= fpos_frag(new_pos)) {
                                ^
                       (                             )
    fs/ceph/dir.c:600:22: note: use '!=' to turn this compound
    assignment into an inequality comparison
            } else if (fi->frag |= fpos_frag(new_pos)) {
                                ^~
                                !=

Fixes: f93494b818bd ("ceph: using hash value to compose dentry offset")
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/dir.c