Skip to content

Commit

Permalink
Merge remote-tracking branch 'gh/hammer'
Browse files Browse the repository at this point in the history
  • Loading branch information
liewegas committed Mar 2, 2015
2 parents 6864dc9 + 206cb70 commit b65f8fa
Show file tree
Hide file tree
Showing 20 changed files with 721 additions and 176 deletions.
2 changes: 1 addition & 1 deletion COPYING
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ License: LGPL2 or later

Files: src/os/btrfs_ioctl.h
Copyright: Copyright (C) 2007 Oracle. All rights reserved.
License: GPL2
License: GPL2 (see COPYING-GPL2)

Files: src/include/ceph_hash.cc
Copyright: None
Expand Down
339 changes: 339 additions & 0 deletions COPYING-GPL2

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions ceph.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,6 @@ fi
%{_bindir}/ceph-mon
%{_bindir}/ceph-mds
%{_bindir}/ceph-osd
%{_bindir}/ceph-rbdnamer
%{_bindir}/librados-config
%{_bindir}/ceph-client-debug
%{_bindir}/cephfs-journal-tool
Expand Down Expand Up @@ -622,7 +621,6 @@ fi
%{_mandir}/man8/monmaptool.8*
%{_mandir}/man8/cephfs.8*
%{_mandir}/man8/mount.ceph.8*
%{_mandir}/man8/ceph-rbdnamer.8*
%{_mandir}/man8/ceph-debugpack.8*
%{_mandir}/man8/ceph-clsinfo.8*
%{_mandir}/man8/librados-config.8*
Expand All @@ -643,6 +641,7 @@ fi
%{_bindir}/ceph-authtool
%{_bindir}/ceph-conf
%{_bindir}/ceph-dencoder
%{_bindir}/ceph-rbdnamer
%{_bindir}/ceph-syn
%{_bindir}/ceph-crush-location
%{_bindir}/rados
Expand All @@ -652,6 +651,7 @@ fi
%{_mandir}/man8/ceph-authtool.8*
%{_mandir}/man8/ceph-conf.8*
%{_mandir}/man8/ceph-dencoder.8*
%{_mandir}/man8/ceph-rbdnamer.8*
%{_mandir}/man8/ceph-syn.8*
%{_mandir}/man8/ceph-post-file.8*
%{_mandir}/man8/ceph.8*
Expand All @@ -667,6 +667,11 @@ fi
%config(noreplace) %{_sysconfdir}/ceph/rbdmap
%{_initrddir}/rbdmap
%{python_sitelib}/ceph_argparse.py*
%if 0%{?rhel} >= 7 || 0%{?fedora}
/usr/lib/udev/rules.d/50-rbd.rules
%else
/lib/udev/rules.d/50-rbd.rules
%endif

%postun -n ceph-common
# Package removal cleanup
Expand Down Expand Up @@ -791,11 +796,6 @@ fi
%files -n librbd1
%defattr(-,root,root,-)
%{_libdir}/librbd.so.*
%if 0%{?rhel} >= 7 || 0%{?fedora}
/usr/lib/udev/rules.d/50-rbd.rules
%else
/lib/udev/rules.d/50-rbd.rules
%endif

%post -n librbd1
/sbin/ldconfig
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ AC_PREREQ(2.59)
# VERSION define is not used by the code. It gets a version string
# from 'git describe'; see src/ceph_ver.[ch]

AC_INIT([ceph], [0.92], [[email protected]])
AC_INIT([ceph], [0.93], [[email protected]])

# Create release string. Used with VERSION for RPMs.
RPM_RELEASE=0
Expand Down
5 changes: 4 additions & 1 deletion debian/ceph-common.install
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ usr/bin/ceph
usr/bin/ceph-authtool
usr/bin/ceph-conf
usr/bin/ceph-dencoder
usr/bin/ceph-rbdnamer
usr/bin/ceph-syn
usr/bin/ceph-crush-location
usr/bin/rados
Expand All @@ -13,6 +14,7 @@ usr/bin/ceph-brag
usr/share/man/man8/ceph-authtool.8
usr/share/man/man8/ceph-conf.8
usr/share/man/man8/ceph-dencoder.8
usr/share/man/man8/ceph-rbdnamer.8
usr/share/man/man8/ceph-syn.8
usr/share/man/man8/ceph-post-file.8
usr/share/man/man8/ceph.8
Expand All @@ -22,4 +24,5 @@ usr/share/ceph/known_hosts_drop.ceph.com
usr/share/ceph/id_dsa_drop.ceph.com
usr/share/ceph/id_dsa_drop.ceph.com.pub
etc/ceph/rbdmap
etc/init.d/rbdmap
etc/init.d/rbdmap
lib/udev/rules.d/50-rbd.rules
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
ceph (0.93-1) stable; urgency=low

* New upstream release

-- Alfredo Deza <[email protected]> Fri, 27 Feb 2015 09:52:53 -0800

ceph (0.92-1) stable; urgency=low

* New upstream release
Expand Down
6 changes: 4 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,11 @@ Depends: librbd1 (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends},
Conflicts: ceph-client-tools
Replaces: ceph-client-tools,
ceph (<< 0.78-500),
python-ceph (<< 0.92-1223)
python-ceph (<< 0.92-1223),
librbd1 (<< 0.92-1238)
Breaks: ceph (<< 0.78-500),
python-ceph (<< 0.92-1223)
python-ceph (<< 0.92-1223),
librbd1 (<< 0.92-1238)
Suggests: ceph, ceph-mds
Description: common utilities to mount and interact with a ceph storage cluster
Ceph is a massively scalable, open-source, distributed
Expand Down
4 changes: 2 additions & 2 deletions debian/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ License: Creative Commons Attribution-ShareAlike (CC BY-SA)

Files: src/mount/canonicalize.c
Copyright: Copyright (C) 1993 Rick Sladkey <[email protected]>
License: LGPL2 or later
License: LGPL2 or later (see COPYING-GPL2)

Files: src/os/btrfs_ioctl.h
Copyright: Copyright (C) 2007 Oracle. All rights reserved.
License: GPL2
License: GPL2 (see COPYING-GPL2)

Files: src/include/ceph_hash.cc
Copyright: None
Expand Down
3 changes: 0 additions & 3 deletions debian/librbd1.install
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
lib/udev/rules.d/50-rbd.rules
usr/bin/ceph-rbdnamer
usr/lib/librbd.so.*
usr/share/man/man8/ceph-rbdnamer.8
12 changes: 6 additions & 6 deletions qa/workunits/rbd/copy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ test_ls() {
echo "testing ls..."
remove_images

rbd create -s 1 test1
rbd create -s 1 test2
rbd create --image-format 1 -s 1 test1
rbd create --image-format 1 -s 1 test2
rbd ls | grep test1
rbd ls | grep test2
rbd ls | wc -l | grep 2
Expand All @@ -120,8 +120,8 @@ test_ls() {
rbd rm test1
rbd rm test2

rbd create --new-format -s 1 test1
rbd create --new-format -s 1 test2
rbd create --image-format 2 -s 1 test1
rbd create --image-format 2 -s 1 test2
rbd ls | grep test1
rbd ls | grep test2
rbd ls | wc -l | grep 2
Expand All @@ -132,7 +132,7 @@ test_ls() {
rbd rm test2

rbd create --new-format -s 1 test1
rbd create -s 1 test2
rbd create --image-format 1 -s 1 test2
rbd ls | grep test1
rbd ls | grep test2
rbd ls | wc -l | grep 2
Expand Down Expand Up @@ -177,7 +177,7 @@ test_remove() {
# by removing some objects manually.

# remove with header missing (old format)
rbd create -s 1 test1
rbd create --image-format 1 -s 1 test1
rados rm -p rbd test1.rbd
rbd rm test1
rbd ls | wc -l | grep "^0$"
Expand Down
72 changes: 62 additions & 10 deletions src/ceph_fuse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/

#include <sys/stat.h>
#include <sys/utsname.h>
#include <iostream>
#include <string>
using namespace std;
Expand Down Expand Up @@ -84,6 +85,8 @@ int main(int argc, const char **argv, const char *envp[]) {
// we need to handle the forking ourselves.
int fd[2] = {0, 0}; // parent's, child's
pid_t childpid = 0;
int tester_r = 0;
void *tester_rp = NULL;
bool restart_log = false;
if (g_conf->daemonize) {
int r = socketpair(AF_UNIX, SOCK_STREAM, 0, fd);
Expand All @@ -107,13 +110,53 @@ int main(int argc, const char **argv, const char *envp[]) {
if (restart_log)
g_ceph_context->_log->start();

class RemountTest : public Thread {
public:
CephFuse *cfuse;
Client *client;
RemountTest() : Thread() {}
void init(CephFuse *cf, Client *cl) {
cfuse = cf;
client = cl;
}
virtual ~RemountTest() {}
virtual void *entry() {
struct utsname os_info;
int tr = uname(&os_info);
assert(tr == 0);
assert(memcmp(os_info.sysname, "Linux", 5) == 0);
int major, minor;
char *end_num;
major = strtol(os_info.release, &end_num, 10);
assert(major > 0);
++end_num;
minor = strtol(end_num, NULL, 10);
bool can_invalidate_dentries = g_conf->client_try_dentry_invalidate &&
(major < 3 ||
(major == 3 && minor < 18));
tr = client->test_dentry_handling(can_invalidate_dentries);
if (tr != 0) {
cerr << "ceph-fuse[" << getpid()
<< "]: fuse failed dentry invalidate/remount test with error "
<< cpp_strerror(tr) << ", stopping" << std::endl;

char buf[5050];
string mountpoint = cfuse->get_mount_point();
snprintf(buf, 5049, "fusermount -u -z %s", mountpoint.c_str());
system(buf);
}
return reinterpret_cast<void*>(tr);
}
} tester;


// get monmap
Messenger *messenger = NULL;
Client *client;
CephFuse *cfuse;

MonClient mc(g_ceph_context);
int r = mc.build_initial_monmap();
MonClient *mc = new MonClient(g_ceph_context);
int r = mc->build_initial_monmap();
if (r == -EINVAL)
usage();
if (r < 0)
Expand All @@ -127,7 +170,7 @@ int main(int argc, const char **argv, const char *envp[]) {
messenger->set_policy(entity_name_t::TYPE_MDS,
Messenger::Policy::lossless_client(0, 0));

client = new Client(messenger, &mc);
client = new Client(messenger, mc);
if (filer_flags) {
client->set_filer_flags(filer_flags);
}
Expand Down Expand Up @@ -169,17 +212,24 @@ int main(int argc, const char **argv, const char *envp[]) {
cerr << "ceph-fuse[" << getpid() << "]: fuse failed to start" << std::endl;
goto out_client_unmount;
}

cerr << "ceph-fuse[" << getpid() << "]: starting fuse" << std::endl;
tester.init(cfuse, client);
tester.create();
r = cfuse->loop();
cerr << "ceph-fuse[" << getpid() << "]: fuse finished with error " << r << std::endl;

tester.join(&tester_rp);
tester_r = static_cast<int>(reinterpret_cast<uint64_t>(tester_rp));
cerr << "ceph-fuse[" << getpid() << "]: fuse finished with error " << r
<< " and tester_r " << tester_r <<std::endl;


out_client_unmount:
client->unmount();
//cout << "unmounted" << std::endl;

cfuse->finalize();
delete cfuse;

out_shutdown:
client->shutdown();
out_init_failed:
Expand All @@ -189,17 +239,19 @@ int main(int argc, const char **argv, const char *envp[]) {
out_messenger_start_failed:
delete client;
out_mc_start_failed:

if (g_conf->daemonize) {
//cout << "child signalling parent with " << r << std::endl;
static int foo = 0;
foo += ::write(fd[1], &r, sizeof(r));
}

delete messenger;
g_ceph_context->put();
free(newargv);


delete mc;

//cout << "child done" << std::endl;
return r;
} else {
Expand Down
Loading

0 comments on commit b65f8fa

Please sign in to comment.