New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mon/FSCommand: fix indentation #15423

Merged
merged 1 commit into from Jun 7, 2017

Conversation

Projects
None yet
3 participants
@liewegas
Member

liewegas commented Jun 2, 2017

Makes this warning go away

/home/sage/src/ceph4/src/mon/FSCommands.cc: In member function ‘virtual int SetHandler::handle(Monitor*, FSMap&, MonOpRequestRef, std::map<std::__cxx11::basic_string, boost::variant<std::__cxx11::basic_string, bool, long int, double, std::vector<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, std::allocator<std::__cxx11::basic_string<char, std::char_traits, std::allocator > > >, std::vector<long int, std::allocator > > >&, std::stringstream&)’:
/home/sage/src/ceph4/src/mon/FSCommands.cc:303:7: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation]
else
^~~~
/home/sage/src/ceph4/src/mon/FSCommands.cc:305:9: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘else’
fsmap.modify_filesystem(
^~~~~

Introduced by a1214a7

Signed-off-by: Sage Weil sage@redhat.com

ss << "setting the metadata load balancer to " << val;
fsmap.modify_filesystem(
fs->fscid,
[val](std::shared_ptr<Filesystem> fs)
{
fs->mds_map.set_balancer(val);
});
}

This comment has been minimized.

@david-z

david-z Jun 2, 2017

Member

@liewegas I think this brace needs to go below line 301, not line 308. Then fsmap.modify_filesystem can set balancer to a string if val is not empty OR set balancer to empty if val is empty.

This comment has been minimized.

@tchaikov

tchaikov Jun 2, 2017

Contributor

agreed. this change prevents us from unsetting the metadata load balancer.

This comment has been minimized.

@david-z

david-z Jun 2, 2017

Member

Oh, sorry, I think we don't need the braces here. The problem is from line 302 to line 307. We can reduce 2 indents from line 302 to line 307 (fsmap.modify_filesystem). :-)

This comment has been minimized.

@tchaikov

tchaikov Jun 2, 2017

Contributor

IMHO, the braces helps with the readability. i guess we should keep them. and as you suggest, we should unindent the fsmap.modify_filesystem() statement.

ss << "setting the metadata load balancer to " << val;
fsmap.modify_filesystem(
fs->fscid,
[val](std::shared_ptr<Filesystem> fs)
{
fs->mds_map.set_balancer(val);
});
}

This comment has been minimized.

@tchaikov

tchaikov Jun 2, 2017

Contributor

agreed. this change prevents us from unsetting the metadata load balancer.

mon/FSCommand: fix indentation
Makes this warning go away

/home/sage/src/ceph4/src/mon/FSCommands.cc: In member function ‘virtual int SetHandler::handle(Monitor*, FSMap&, MonOpRequestRef, std::map<std::__cxx11::basic_string<char>, boost::variant<std::__cxx11::basic_string<char>, bool, long int, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long int, std::allocator<long int> > > >&, std::stringstream&)’:
/home/sage/src/ceph4/src/mon/FSCommands.cc:303:7: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation]
       else
       ^~~~
/home/sage/src/ceph4/src/mon/FSCommands.cc:305:9: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘else’
         fsmap.modify_filesystem(
         ^~~~~

Introduced by a1214a7

Signed-off-by: Sage Weil <sage@redhat.com>

@tchaikov tchaikov merged commit 853ae30 into ceph:master Jun 7, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment