Skip to content
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

FreeBSD related fixes #7170

Merged
merged 8 commits into from Mar 14, 2016
Merged

FreeBSD related fixes #7170

merged 8 commits into from Mar 14, 2016

Conversation

trociny
Copy link
Contributor

@trociny trociny commented Jan 10, 2016

No description provided.

@tchaikov
Copy link
Contributor

@trociny lgtm apart from fa05220: although i prefer your approach, seems #7340 is likely to be merged first.

@trociny
Copy link
Contributor Author

trociny commented Jan 31, 2016

@tchaikov
It looks like #7340 does not totally resolve the issue (left the comment there). I will remove my patch from this PR after it is resolved.

@tchaikov
Copy link
Contributor

@adamemerson ping?

@tchaikov
Copy link
Contributor

tchaikov commented Feb 8, 2016

@trociny since #7466 was merged. would you remove fa05220 from your commits?

@trociny
Copy link
Contributor Author

trociny commented Feb 8, 2016

@tchaikov thanks for the remainder. Rebased.

@@ -86,11 +87,6 @@ libcommon_internal_la_SOURCES += \
common/pick_address.cc
endif

if LINUX
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trociny are you sure linux_versoin.c compiles on Solaris also? see #6416

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tchaikov I don't have a Solaris to check, but linux_versoin.c uses uname(). It looks like it is present on Solaris too and compatible.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trociny agreed . see http://www.opensolarisforum.org/man/man2/uname.html @rohanmars could you help confirm this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trociny & @tchaikov linux_version.c looks like it compiles.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rohanmars But it is also used by FileStore. Isn't FileStore built on Solaris?

@tchaikov
Copy link
Contributor

lgtm unless @rohanmars thinks otherwise.

@@ -103,10 +99,8 @@ libcommon_internal_la_SOURCES += \
endif

# used by RBD and FileStore
if LINUX
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trociny & @tchaikov this will not compile on Solaris however, I had originally added a if WITH_RBD around that file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rohanmars Sorry, my previous message (it is also used by FileStore) actually was for this comment.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trociny, no FileStore is not built for client side as I understand. Due to limitation on Makefile.am syntax, probably best to add another if FREE_BSD or something. Not sure why WITH_RBD guard was taken away.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably because it is used by FileStore and BlueStore. can we guard it with WITH_OSD and `!SOLARIS?

@wjwithagen
Copy link
Contributor

@rohanmars @trociny @tchaikov
linux_version is only used to determine how caching is set on disks in linux.
I would recone that in both Solaris as in FreeBSD that is done completely different, IF it is even possible. So the solution is to not use linux_version unless we're using Linux, and thus also exclude the code in FileJournal.cc

@tchaikov tchaikov removed the needs-qa label Feb 17, 2016
@tchaikov
Copy link
Contributor

linux_version is only used to determine how caching is set on disks in linux.

@wjwithagen you are right, get_linux_version() is used to check the features (extsize, write cache, dentry invalidation) by comparing the linux version number. but it does not hurt if we compile it and use it check result, as the number returned by get_linux_version() is 0 if it runs on FreeBSD or Solaris. at the caller side, we tend to be conservative at seeing 0, and hence disable feature being test. so we have less #if __linux__ in upper layer of caller. and hide the platform specific thing in the common/ directory.

if our goal is to port the ceph client, maybe we can guard "common/linux_version.c" with

if ENABLE_SERVER
libcommon_internal_la_SOURCES += \
    common/linux_version.c
else
if WITH_FUSE
libcommon_internal_la_SOURCES += \
    common/linux_version.c
else
endif
endif

@wjwithagen
Copy link
Contributor

@tchaikov
I agree with your objective, but then as such I have contemplated to rename linux_version.cc to os_version.cc which allows for adding more versions without major changes to the compile infra.
And it can always be included.

Now the problem is when such a block of code tries to call OS specific functions.
Then we still need to ifdef that block of code at the point of using the get_OS_version, otherwise is does not compile.
But it removes the ifdefs in the makefile-infra

Looking at the code in ./src/os/filestore/FileJournal.cc there are errors/warnings printed that are not relevant on other platforms and those might confuse a admin. Even text that is highlighted in RED.
So those prints need only be done if get_linux_level <> 0

BTW: calls are at:
./src/os/filestore/FileJournal.cc: int ver = get_linux_version();
./src/os/filestore/XfsFileStoreBackend.cc: int ver = get_linux_version();
./src/ceph_fuse.cc: int ver = get_linux_version();

@trociny
Copy link
Contributor Author

trociny commented Feb 18, 2016

Ok, I tend to agree that linux_version.c should be included only on linux platform, and get_linux_version() (together with linux only relevant code around it) be ifdefed.

As for blkdev.cc I think it should be included for all platforms with os specific things ifdefed in blkdev.cc.

I will come with the patch later.

@tchaikov
Copy link
Contributor

@wjwithagen agreed!

@trociny
Copy link
Contributor Author

trociny commented Feb 20, 2016

rebased after updating the patch for linux_version.c and blkdev.cc handling.

@trociny
Copy link
Contributor Author

trociny commented Feb 24, 2016

Rebased after updating stop.sh

@tchaikov
Copy link
Contributor

tchaikov commented Mar 9, 2016

@trociny could rebase the PR against master, and i think it's ready for needs-qa.

Mykola Golub added 4 commits March 9, 2016 07:50
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
- export CC and CXX, so the same compiler is used
- use NPROC

Signed-off-by: Mykola Golub <mgolub@mirantis.com>
On freebsd <malloc.h> has been replaced by <stdlib.h>

Signed-off-by: Mykola Golub <mgolub@mirantis.com>
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
Mykola Golub added 4 commits March 9, 2016 07:51
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
(excluding linux specific features)

Signed-off-by: Mykola Golub <mgolub@mirantis.com>
`$(CC) -dumpversion` works for clang too, as it supports gcc
compatibility for -dumpversion option.

Signed-off-by: Mykola Golub <mgolub@mirantis.com>
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
@trociny
Copy link
Contributor Author

trociny commented Mar 9, 2016

rebased against the recent master

@tchaikov
Copy link
Contributor

tchaikov commented Mar 9, 2016

lgtm with qa run.

@wjwithagen
Copy link
Contributor

@trociny @tchaikov Nice...
happy with the blockdev implementation
Once this is in it'll remove quite some of my commits in wip-wjw-freebsd-*

tchaikov added a commit that referenced this pull request Mar 14, 2016
FreeBSD related fixes

Reviewed-by: Kefu Chai <kchai@redhat.com>
@tchaikov tchaikov merged commit 0d6d340 into ceph:master Mar 14, 2016
@trociny trociny deleted the wip-freebsd-misc branch March 14, 2016 10:45
@wjwithagen
Copy link
Contributor

@tchaikov
Cool,thanx for this merge.
I'll update my pull-set after I've run some tests with Clang 3.7 to check why I'm having crashes that did not happen before the upgrade to 3.8. But I'm down with flue and lots of work that makes money.
So it'll be a day or 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants