Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
de12ebe8
Commit
de12ebe8
authored
1 year ago
by
Michael Davis
Browse files
Options
Downloads
Patches
Plain Diff
Resolve "cta-rmcd issues if `/dev/sg0` is missing"
parent
0726c5bc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ReleaseNotes.md
+6
-0
6 additions, 0 deletions
ReleaseNotes.md
mediachanger/castorrmc/rmc/rmc_send_scsi_cmd.c
+8
-13
8 additions, 13 deletions
mediachanger/castorrmc/rmc/rmc_send_scsi_cmd.c
with
14 additions
and
13 deletions
ReleaseNotes.md
+
6
−
0
View file @
de12ebe8
# v4.NEXT
### Features
### Bug Fixes
-
cta/CTA#259 - cta-rmcd should not exit if /dev/sg0 is missing
# v4.8.7-1
### Features
...
...
This diff is collapsed.
Click to expand it.
mediachanger/castorrmc/rmc/rmc_send_scsi_cmd.c
+
8
−
13
View file @
de12ebe8
...
...
@@ -164,7 +164,6 @@ int rmc_send_scsi_cmd (
int
n
;
int
resid
=
0
;
struct
stat
sbuf
;
struct
stat
sbufa
;
static
char
*
sg_buffer
;
static
int
sg_bufsiz
=
0
;
struct
sg_header
*
sg_hd
;
...
...
@@ -220,19 +219,15 @@ int rmc_send_scsi_cmd (
return
(
-
1
);
}
/* get the major device ID of the sg devices ... */
if
(
stat
(
"/dev/sg0"
,
&
sbufa
)
<
0
)
{
serrno
=
errno
;
snprintf
(
rmc_err_msgbuf
,
sizeof
(
rmc_err_msgbuf
),
"/dev/sg0 : stat error : %s
\n
"
,
strerror
(
errno
));
rmc_err_msgbuf
[
sizeof
(
rmc_err_msgbuf
)
-
1
]
=
'\0'
;
*
msgaddr
=
rmc_err_msgbuf
;
return
(
-
1
);
}
/* ... to detect links and use the path directly! */
if
(
major
(
sbuf
.
st_rdev
)
==
major
(
sbufa
.
st_rdev
))
{
strcpy
(
sgpath
,
path
);
struct
stat
sbufa
;
if
(
stat
(
"/dev/sg0"
,
&
sbufa
)
==
0
&&
major
(
sbuf
.
st_rdev
)
==
major
(
sbufa
.
st_rdev
))
{
/* If the major device ID of the specified device is the same as the major device ID of sg0,
* we can use the path directly */
strcpy
(
sgpath
,
path
);
}
else
{
find_sgpath
(
sgpath
,
major
(
sbuf
.
st_rdev
),
minor
(
sbuf
.
st_rdev
));
/* Otherwise, look up the path using the (major,minor) device ID. If no match is found,
* sgpath is set to an empty string */
find_sgpath
(
sgpath
,
major
(
sbuf
.
st_rdev
),
minor
(
sbuf
.
st_rdev
));
}
if
((
fd
=
open
(
sgpath
,
O_RDWR
))
<
0
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment