Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
65555a06
Commit
65555a06
authored
Oct 25, 2007
by
Yan
Committed by
Chris Mason
Sep 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Btrfs: Off by one fixes in extent_map.c
Signed-off-by:
Chris Mason
<
chris.mason@oracle.com
>
parent
f578d4bd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
fs/btrfs/extent_map.c
fs/btrfs/extent_map.c
+5
-5
fs/btrfs/inode.c
fs/btrfs/inode.c
+1
-0
No files found.
fs/btrfs/extent_map.c
View file @
65555a06
...
@@ -2045,7 +2045,7 @@ struct extent_buffer *alloc_extent_buffer(struct extent_map_tree *tree,
...
@@ -2045,7 +2045,7 @@ struct extent_buffer *alloc_extent_buffer(struct extent_map_tree *tree,
struct
extent_buffer
*
eb
;
struct
extent_buffer
*
eb
;
struct
page
*
p
;
struct
page
*
p
;
struct
address_space
*
mapping
=
tree
->
mapping
;
struct
address_space
*
mapping
=
tree
->
mapping
;
int
uptodate
=
0
;
int
uptodate
=
1
;
eb
=
__alloc_extent_buffer
(
tree
,
start
,
len
,
mask
);
eb
=
__alloc_extent_buffer
(
tree
,
start
,
len
,
mask
);
if
(
!
eb
||
IS_ERR
(
eb
))
if
(
!
eb
||
IS_ERR
(
eb
))
...
@@ -2197,7 +2197,7 @@ int clear_extent_buffer_dirty(struct extent_map_tree *tree,
...
@@ -2197,7 +2197,7 @@ int clear_extent_buffer_dirty(struct extent_map_tree *tree,
*/
*/
if
((
i
==
0
&&
(
eb
->
start
&
(
PAGE_CACHE_SIZE
-
1
)))
||
if
((
i
==
0
&&
(
eb
->
start
&
(
PAGE_CACHE_SIZE
-
1
)))
||
((
i
==
num_pages
-
1
)
&&
((
i
==
num_pages
-
1
)
&&
((
eb
->
start
+
eb
->
len
-
1
)
&
(
PAGE_CACHE_SIZE
-
1
))))
{
((
eb
->
start
+
eb
->
len
)
&
(
PAGE_CACHE_SIZE
-
1
))))
{
start
=
page
->
index
<<
PAGE_CACHE_SHIFT
;
start
=
page
->
index
<<
PAGE_CACHE_SHIFT
;
end
=
start
+
PAGE_CACHE_SIZE
-
1
;
end
=
start
+
PAGE_CACHE_SIZE
-
1
;
if
(
test_range_bit
(
tree
,
start
,
end
,
if
(
test_range_bit
(
tree
,
start
,
end
,
...
@@ -2265,7 +2265,7 @@ int set_extent_buffer_uptodate(struct extent_map_tree *tree,
...
@@ -2265,7 +2265,7 @@ int set_extent_buffer_uptodate(struct extent_map_tree *tree,
page
=
extent_buffer_page
(
eb
,
i
);
page
=
extent_buffer_page
(
eb
,
i
);
if
((
i
==
0
&&
(
eb
->
start
&
(
PAGE_CACHE_SIZE
-
1
)))
||
if
((
i
==
0
&&
(
eb
->
start
&
(
PAGE_CACHE_SIZE
-
1
)))
||
((
i
==
num_pages
-
1
)
&&
((
i
==
num_pages
-
1
)
&&
((
eb
->
start
+
eb
->
len
-
1
)
&
(
PAGE_CACHE_SIZE
-
1
))))
{
((
eb
->
start
+
eb
->
len
)
&
(
PAGE_CACHE_SIZE
-
1
))))
{
check_page_uptodate
(
tree
,
page
);
check_page_uptodate
(
tree
,
page
);
continue
;
continue
;
}
}
...
@@ -2401,7 +2401,7 @@ int map_private_extent_buffer(struct extent_buffer *eb, unsigned long start,
...
@@ -2401,7 +2401,7 @@ int map_private_extent_buffer(struct extent_buffer *eb, unsigned long start,
struct
page
*
p
;
struct
page
*
p
;
size_t
start_offset
=
eb
->
start
&
((
u64
)
PAGE_CACHE_SIZE
-
1
);
size_t
start_offset
=
eb
->
start
&
((
u64
)
PAGE_CACHE_SIZE
-
1
);
unsigned
long
i
=
(
start_offset
+
start
)
>>
PAGE_CACHE_SHIFT
;
unsigned
long
i
=
(
start_offset
+
start
)
>>
PAGE_CACHE_SHIFT
;
unsigned
long
end_i
=
(
start_offset
+
start
+
min_len
)
>>
unsigned
long
end_i
=
(
start_offset
+
start
+
min_len
-
1
)
>>
PAGE_CACHE_SHIFT
;
PAGE_CACHE_SHIFT
;
if
(
i
!=
end_i
)
if
(
i
!=
end_i
)
...
@@ -2414,7 +2414,7 @@ int map_private_extent_buffer(struct extent_buffer *eb, unsigned long start,
...
@@ -2414,7 +2414,7 @@ int map_private_extent_buffer(struct extent_buffer *eb, unsigned long start,
offset
=
0
;
offset
=
0
;
*
map_start
=
(
i
<<
PAGE_CACHE_SHIFT
)
-
start_offset
;
*
map_start
=
(
i
<<
PAGE_CACHE_SHIFT
)
-
start_offset
;
}
}
if
(
start
+
min_len
>
=
eb
->
len
)
{
if
(
start
+
min_len
>
eb
->
len
)
{
printk
(
"bad mapping eb start %Lu len %lu, wanted %lu %lu
\n
"
,
eb
->
start
,
eb
->
len
,
start
,
min_len
);
printk
(
"bad mapping eb start %Lu len %lu, wanted %lu %lu
\n
"
,
eb
->
start
,
eb
->
len
,
start
,
min_len
);
WARN_ON
(
1
);
WARN_ON
(
1
);
}
}
...
...
fs/btrfs/inode.c
View file @
65555a06
...
@@ -616,6 +616,7 @@ static int btrfs_truncate_in_trans(struct btrfs_trans_handle *trans,
...
@@ -616,6 +616,7 @@ static int btrfs_truncate_in_trans(struct btrfs_trans_handle *trans,
break
;
break
;
}
}
btrfs_set_key_type
(
&
key
,
found_type
);
btrfs_set_key_type
(
&
key
,
found_type
);
btrfs_release_path
(
root
,
path
);
continue
;
continue
;
}
}
if
(
found_key
.
offset
>=
inode
->
i_size
)
if
(
found_key
.
offset
>=
inode
->
i_size
)
...
...
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