Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
7b193c81
Commit
7b193c81
authored
Apr 03, 2016
by
Christian Brauner
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #936 from overlayfs/btrfs_recursive_destroy
fix btrfs_recursive_destroy
parents
89f6299a
58232f8c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
lxcbtrfs.c
src/lxc/bdev/lxcbtrfs.c
+10
-3
No files found.
src/lxc/bdev/lxcbtrfs.c
View file @
7b193c81
...
@@ -568,7 +568,7 @@ static int btrfs_recursive_destroy(const char *path)
...
@@ -568,7 +568,7 @@ static int btrfs_recursive_destroy(const char *path)
struct
btrfs_ioctl_search_header
sh
;
struct
btrfs_ioctl_search_header
sh
;
struct
btrfs_root_ref
*
ref
;
struct
btrfs_root_ref
*
ref
;
struct
my_btrfs_tree
*
tree
;
struct
my_btrfs_tree
*
tree
;
int
ret
,
i
;
int
ret
,
e
,
i
;
unsigned
long
off
=
0
;
unsigned
long
off
=
0
;
int
name_len
;
int
name_len
;
char
*
name
;
char
*
name
;
...
@@ -582,8 +582,9 @@ static int btrfs_recursive_destroy(const char *path)
...
@@ -582,8 +582,9 @@ static int btrfs_recursive_destroy(const char *path)
}
}
if
(
btrfs_list_get_path_rootid
(
fd
,
&
root_id
))
{
if
(
btrfs_list_get_path_rootid
(
fd
,
&
root_id
))
{
e
=
errno
;
close
(
fd
);
close
(
fd
);
if
(
e
rrno
==
EPERM
||
errno
==
EACCES
)
{
if
(
e
==
EPERM
||
e
==
EACCES
)
{
WARN
(
"Will simply try removing"
);
WARN
(
"Will simply try removing"
);
goto
ignore_search
;
goto
ignore_search
;
}
}
...
@@ -614,10 +615,16 @@ static int btrfs_recursive_destroy(const char *path)
...
@@ -614,10 +615,16 @@ static int btrfs_recursive_destroy(const char *path)
while
(
1
)
{
while
(
1
)
{
ret
=
ioctl
(
fd
,
BTRFS_IOC_TREE_SEARCH
,
&
args
);
ret
=
ioctl
(
fd
,
BTRFS_IOC_TREE_SEARCH
,
&
args
);
e
=
errno
;
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
close
(
fd
);
close
(
fd
);
ERROR
(
"Error: can't perform the search under %s
\n
"
,
path
);
free_btrfs_tree
(
tree
);
free_btrfs_tree
(
tree
);
if
(
e
==
EPERM
||
e
==
EACCES
)
{
WARN
(
"Warn: can't perform the search under %s. Will simply try removing"
,
path
);
goto
ignore_search
;
}
ERROR
(
"Error: can't perform the search under %s
\n
"
,
path
);
return
-
1
;
return
-
1
;
}
}
if
(
sk
->
nr_items
==
0
)
if
(
sk
->
nr_items
==
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment