From f1c796857d89b9265add7fcb2eadbba43b6b3920 Mon Sep 17 00:00:00 2001 From: anwleung Date: Tue, 27 Mar 2007 19:06:25 +0000 Subject: [PATCH] minor unix group tweaking git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1308 29311d96-e01e-0410-9327-a35deaab8ce9 --- branches/aleung/security1/ceph/.groups | 2 +- branches/aleung/security1/ceph/mds/Locker.cc | 12 +++++++----- branches/aleung/security1/ceph/mds/MDS.cc | 6 +++--- branches/aleung/security1/ceph/mds/Server.cc | 4 ++-- branches/aleung/security1/ceph/trace_convert.pl | 2 ++ 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/branches/aleung/security1/ceph/.groups b/branches/aleung/security1/ceph/.groups index 2a96f7b2268e8..1234342ef6b92 100644 --- a/branches/aleung/security1/ceph/.groups +++ b/branches/aleung/security1/ceph/.groups @@ -1,4 +1,4 @@ 1000 1000 3500 -1 100 3407 -1 1500 384 555 -1 -1020 340 341 342 343 344 345 346 -1 \ No newline at end of file +1020 340 341 342 343 344 345 346 347 348 349 350 -1 \ No newline at end of file diff --git a/branches/aleung/security1/ceph/mds/Locker.cc b/branches/aleung/security1/ceph/mds/Locker.cc index 8013e826a8991..f4a5530edf5ac 100644 --- a/branches/aleung/security1/ceph/mds/Locker.cc +++ b/branches/aleung/security1/ceph/mds/Locker.cc @@ -249,7 +249,7 @@ ExtCap* Locker::issue_new_extcaps(CInode *in, int mode, MClientRequest *req) { else ext_cap = in->get_unix_world_cap(); } - if (g_conf.mds_group == 4) { + else if (g_conf.mds_group == 4) { if (mds->predict_cap_cache[in->ino()].count(my_user) == 0) ext_cap = 0; else @@ -313,14 +313,14 @@ ExtCap* Locker::issue_new_extcaps(CInode *in, int mode, MClientRequest *req) { else if (g_conf.mds_group == 4) { // can we make any predictions? if (mds->precompute_succ.count(in->ino()) != 0) { - cout << "Making a prediction in capability for " << in->ino() << endl; + //cout << "Making a prediction in capability for " << in->ino() << endl; // add the hash hash_t inode_hash = mds->precompute_succ[in->ino()]; ext_cap = new ExtCap(FILE_MODE_RW, my_user, my_group, inode_hash); ext_cap->set_type(USER_BATCH); } else { - cout << "Can't make predictions for this cap for " << in->ino() << endl; + //cout << "Can't make predictions for this cap for " << in->ino() << endl; ext_cap = new ExtCap(my_want, my_user, in->ino()); ext_cap->set_type(0); } @@ -343,9 +343,11 @@ ExtCap* Locker::issue_new_extcaps(CInode *in, int mode, MClientRequest *req) { // caches this capability in the inode if (g_conf.mds_group == 1) { - if (my_user == in->get_uid()) + if (my_user == in->get_uid()) { in->set_unix_user_cap(ext_cap); - else if(my_user == in->get_gid()) + in->set_unix_group_cap(ext_cap); + } + else if(my_group == in->get_gid()) in->set_unix_group_cap(ext_cap); else in->set_unix_world_cap(ext_cap); diff --git a/branches/aleung/security1/ceph/mds/MDS.cc b/branches/aleung/security1/ceph/mds/MDS.cc index d461f8d2f25b8..a81aa93c7d761 100644 --- a/branches/aleung/security1/ceph/mds/MDS.cc +++ b/branches/aleung/security1/ceph/mds/MDS.cc @@ -167,14 +167,14 @@ MDS::MDS(int whoami, Messenger *m, MonMap *mm) : timer(mds_lock) { inodeno_t prediction; prediction = rp_predicter.predict_successor(mi->first); - cout << "Predictions for " << mi->first << ": "; + //cout << "Predictions for " << mi->first << ": "; while(prediction != inodeno_t()) { - cout << prediction << ", "; + //cout << prediction << ", "; inode_list.add_inode(prediction); prediction = rp_predicter.predict_successor(prediction); } - cout << "Cannot make any further predictions" << endl; + //cout << "Cannot make any further predictions" << endl; // cache the list if (inode_list.num_inodes() != 0) { diff --git a/branches/aleung/security1/ceph/mds/Server.cc b/branches/aleung/security1/ceph/mds/Server.cc index dac2eb23c5a02..b7b656f4e7244 100644 --- a/branches/aleung/security1/ceph/mds/Server.cc +++ b/branches/aleung/security1/ceph/mds/Server.cc @@ -2495,7 +2495,7 @@ void Server::handle_client_open(MClientRequest *req, utime_t sec_time_start = g_clock.now(); ext_cap = mds->locker->issue_new_extcaps(cur, mode, req); utime_t sec_time_end = g_clock.now(); - dout(1) << "Get security cap time " << sec_time_end - sec_time_start << endl; + dout(2) << "Get security cap time " << sec_time_end - sec_time_start << endl; Capability *cap = mds->locker->issue_new_caps(cur, mode, req); if (!cap) return; // can't issue (yet), so wait! @@ -2505,7 +2505,7 @@ void Server::handle_client_open(MClientRequest *req, mds->balancer->hit_inode(cur, META_POP_IRD); end_time = g_clock.now(); - dout(1) << "Open() request latency " << end_time - start_time << endl; + dout(2) << "Open() request latency " << end_time - start_time << endl; if (mds->logger) { mds->logger->finc("lsum", (double) end_time - start_time); mds->logger->inc("lnum"); diff --git a/branches/aleung/security1/ceph/trace_convert.pl b/branches/aleung/security1/ceph/trace_convert.pl index 34d7d54ca3319..8b2a913f74b71 100755 --- a/branches/aleung/security1/ceph/trace_convert.pl +++ b/branches/aleung/security1/ceph/trace_convert.pl @@ -21,6 +21,7 @@ for $file_handle(@files) { @file_data = ; my $line; my @args; + my @unclosed_fds; foreach $line (@file_data) { my $timestamp; @@ -46,6 +47,7 @@ for $file_handle(@files) { ($op, $path, $rest) = split(/\"/, $op); print OUT "open\n$path\n102\n$ret_val\n"; } + push @unclosed_fds; } elsif ($op =~ /close\(/) { my $nothing; -- 2.39.5