From: Kern Sibbald Date: Sun, 3 Dec 2006 20:01:09 +0000 (+0000) Subject: kes Enable disk seeking on restore. X-Git-Tag: Release-2.0.0~179 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=755e7bc8059e1e2dfc53838db95656d5e73a6635;p=bacula%2Fbacula kes Enable disk seeking on restore. kes Implement the SD 'Block Positioning = yes|no' directive. This allows the user to turn off block level seeking, but restores will be much slower. kes Change the word illegal to read invalid in a few places. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3738 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index 8e6bb272d9..c9f37be433 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -177,7 +177,7 @@ int do_a_command(UAContext *ua, const char *cmd) } } if (!found) { - bnet_fsend(ua->UA_sock, _("%s: is an illegal command.\n"), ua->argk[0]); + bnet_fsend(ua->UA_sock, _("%s: is an invalid command.\n"), ua->argk[0]); } return stat; } @@ -613,7 +613,7 @@ static int setip_cmd(UAContext *ua, const char *cmd) CLIENT *client; char buf[1024]; if (!ua->cons || !acl_access_ok(ua, Client_ACL, ua->cons->hdr.name)) { - bsendmsg(ua, _("Illegal command from this console.\n")); + bsendmsg(ua, _("Unauthorized command from this console.\n")); return 1; } LockRes(); @@ -659,7 +659,7 @@ static void do_en_disable_cmd(UAContext *ua, bool setting) } if (!acl_access_ok(ua, Job_ACL, job->hdr.name)) { - bsendmsg(ua, _("Illegal command from this console.\n")); + bsendmsg(ua, _("Unauthorized command from this console.\n")); return; } job->enabled = setting; diff --git a/bacula/src/dird/ua_dotcmds.c b/bacula/src/dird/ua_dotcmds.c index 3d0d9bb53a..ec084e252f 100644 --- a/bacula/src/dird/ua_dotcmds.c +++ b/bacula/src/dird/ua_dotcmds.c @@ -115,7 +115,7 @@ int do_a_dot_command(UAContext *ua, const char *cmd) } } if (!found) { - pm_strcat(ua->UA_sock->msg, _(": is an illegal command\n")); + pm_strcat(ua->UA_sock->msg, _(": is an invalid command\n")); ua->UA_sock->msglen = strlen(ua->UA_sock->msg); bnet_send(ua->UA_sock); } diff --git a/bacula/src/dird/ua_output.c b/bacula/src/dird/ua_output.c index 2e2dcf61e0..231e64f0da 100644 --- a/bacula/src/dird/ua_output.c +++ b/bacula/src/dird/ua_output.c @@ -428,7 +428,7 @@ static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist) if (j >= 0) { n = atoi(ua->argv[j]); if ((n < 0) || (n > 50)) { - bsendmsg(ua, _("Ignoring illegal value for days.\n")); + bsendmsg(ua, _("Ignoring invalid value for days. Max is 50.\n")); n = 1; } } diff --git a/bacula/src/dird/ua_status.c b/bacula/src/dird/ua_status.c index fc1c2d889a..fbc1628146 100644 --- a/bacula/src/dird/ua_status.c +++ b/bacula/src/dird/ua_status.c @@ -462,7 +462,7 @@ static void list_scheduled_jobs(UAContext *ua) if (i >= 0) { days = atoi(ua->argv[i]); if ((days < 0) || (days > 50)) { - bsendmsg(ua, _("Ignoring illegal value for days.\n")); + bsendmsg(ua, _("Ignoring invalid value for days. Max is 50.\n")); days = 1; } } diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index e7d5234655..f6cb4a91a3 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -124,7 +124,7 @@ static char runscript[] = "Run OnSuccess=%u OnFailure=%u AbortOnError=%u When= /* Responses sent to Director */ static char errmsg[] = "2999 Invalid command\n"; static char no_auth[] = "2998 No Authorization\n"; -static char illegal_cmd[] = "2997 Illegal command for a Director with Monitor directive enabled\n"; +static char invalid_cmd[] = "2997 Invalid command for a Director with Monitor directive enabled.\n"; static char OKinc[] = "2000 OK include\n"; static char OKest[] = "2000 OK estimate files=%u bytes=%s\n"; static char OKlevel[] = "2000 OK level\n"; @@ -223,8 +223,8 @@ void *handle_client_request(void *dirp) break; } if ((jcr->authenticated) && (!cmds[i].monitoraccess) && (jcr->director->monitor)) { - Dmsg1(100, "Command %s illegal.\n", cmds[i].cmd); - bnet_fsend(dir, illegal_cmd); + Dmsg1(100, "Command \"%s\" is invalid.\n", cmds[i].cmd); + bnet_fsend(dir, invalid_cmd); bnet_sig(dir, BNET_EOD); break; } diff --git a/bacula/src/stored/btape.c b/bacula/src/stored/btape.c index bd5a265bff..4c7a7c5bbc 100644 --- a/bacula/src/stored/btape.c +++ b/bacula/src/stored/btape.c @@ -2572,7 +2572,7 @@ do_tape_cmds() break; } if (!found) { - Pmsg1(0, _("\"%s\" is an illegal command\n"), cmd); + Pmsg1(0, _("\"%s\" is an invalid command\n"), cmd); } } } diff --git a/bacula/src/stored/dircmd.c b/bacula/src/stored/dircmd.c index fb8312c128..8987fbfb1d 100644 --- a/bacula/src/stored/dircmd.c +++ b/bacula/src/stored/dircmd.c @@ -62,7 +62,7 @@ extern bool init_done; /* Static variables */ static char derrmsg[] = "3900 Invalid command\n"; static char OKsetdebug[] = "3000 OK setdebug=%d\n"; -static char illegal_cmd[] = "3997 Illegal command for a Director with Monitor directive enabled\n"; +static char invalid_cmd[] = "3997 Invalid command for a Director with Monitor directive enabled.\n"; /* Imported functions */ extern void terminate_child(); @@ -212,8 +212,8 @@ void *handle_connection_request(void *arg) for (i=0; cmds[i].cmd; i++) { if (strncmp(cmds[i].cmd, bs->msg, strlen(cmds[i].cmd)) == 0) { if ((!cmds[i].monitoraccess) && (jcr->director->monitor)) { - Dmsg1(100, "Command %s illegal.\n", cmds[i].cmd); - bnet_fsend(bs, illegal_cmd); + Dmsg1(100, "Command \"%s\" is invalid.\n", cmds[i].cmd); + bnet_fsend(bs, invalid_cmd); bnet_sig(bs, BNET_EOD); break; } diff --git a/bacula/src/stored/match_bsr.c b/bacula/src/stored/match_bsr.c index 4cf196230f..e613c3e741 100755 --- a/bacula/src/stored/match_bsr.c +++ b/bacula/src/stored/match_bsr.c @@ -191,13 +191,10 @@ BSR *find_next_bsr(BSR *root_bsr, DEVICE *dev) { BSR *bsr; BSR *found_bsr = NULL; - bool no_file_seek = !dev->is_tape(); -#ifdef FILE_SEEK - no_file_seek = false; -#endif + /* Do tape/disk seeking only if CAP_POSITIONBLOCKS is on */ if (!root_bsr || !root_bsr->use_positioning || - !root_bsr->reposition || no_file_seek) { + !root_bsr->reposition || !dev->has_cap(CAP_POSITIONBLOCKS)) { Dmsg2(dbglevel, "No nxt_bsr use_pos=%d repos=%d\n", root_bsr->use_positioning, root_bsr->reposition); return NULL; } diff --git a/bacula/src/stored/read_record.c b/bacula/src/stored/read_record.c index ae512567e6..b2dc3113f1 100644 --- a/bacula/src/stored/read_record.c +++ b/bacula/src/stored/read_record.c @@ -333,12 +333,10 @@ static bool try_repositioning(JCR *jcr, DEV_RECORD *rec, DCR *dcr) * when find_next_bsr() is fixed not to return a bsr already * completed. */ -#ifdef xxx if (dev->file > bsr->volfile->sfile || (dev->file == bsr->volfile->sfile && dev->block_num > bsr->volblock->sblock)) { return false; } -#endif if (verbose) { Jmsg(jcr, M_INFO, 0, _("Reposition from (file:block) %u:%u to %u:%u\n"), dev->file, dev->block_num, bsr->volfile->sfile, diff --git a/bacula/technotes-1.39 b/bacula/technotes-1.39 index 712f3d51c9..8265b4e174 100644 --- a/bacula/technotes-1.39 +++ b/bacula/technotes-1.39 @@ -2,6 +2,11 @@ General: 03Dec06 +kes Enable disk seeking on restore. +kes Implement the SD 'Block Positioning = yes|no' directive. This + allows the user to turn off block level seeking, but restores + will be much slower. +kes Change the word illegal to read invalid in a few places. kes Fix Win32 build, which broke when I added parse_args_only in lib. I'm not sure I got the entry point right for msvc. kes Turn off data encryption. It can be enabled by defining