Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci-2.6.23
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci-2.6.23
Commits
a01ac532
Commit
a01ac532
authored
Sep 08, 2005
by
Anton Altaparmakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NTFS: Fix page_has_buffers()/page_buffers() handling in fs/ntfs/aops.c.
Signed-off-by:
Anton Altaparmakov
<
aia21@cantab.net
>
parent
311120ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
17 deletions
+22
-17
fs/ntfs/ChangeLog
fs/ntfs/ChangeLog
+1
-0
fs/ntfs/aops.c
fs/ntfs/aops.c
+21
-17
No files found.
fs/ntfs/ChangeLog
View file @
a01ac532
...
...
@@ -85,6 +85,7 @@ ToDo/Notes:
removal of the get_bh()/put_bh() pairs for each buffer.
- Fix fs/ntfs/aops.c::ntfs_{read,write}_block() to handle the case
where a concurrent truncate has truncated the runlist under our feet.
- Fix page_has_buffers()/page_buffers() handling in fs/ntfs/aops.c.
2.1.23 - Implement extension of resident files and make writing safe as well as
many bug fixes, cleanups, and enhancements...
...
...
fs/ntfs/aops.c
View file @
a01ac532
...
...
@@ -185,13 +185,15 @@ static int ntfs_read_block(struct page *page)
blocksize_bits
=
VFS_I
(
ni
)
->
i_blkbits
;
blocksize
=
1
<<
blocksize_bits
;
if
(
!
page_has_buffers
(
page
))
if
(
!
page_has_buffers
(
page
))
{
create_empty_buffers
(
page
,
blocksize
,
0
);
bh
=
head
=
page_buffers
(
page
);
if
(
unlikely
(
!
bh
))
{
unlock_page
(
page
)
;
return
-
ENOMEM
;
if
(
unlikely
(
!
page_has_buffers
(
page
)))
{
unlock_page
(
page
);
return
-
ENOMEM
;
}
}
bh
=
head
=
page_buffers
(
page
);
BUG_ON
(
!
bh
);
iblock
=
(
s64
)
page
->
index
<<
(
PAGE_CACHE_SHIFT
-
blocksize_bits
);
read_lock_irqsave
(
&
ni
->
size_lock
,
flags
);
...
...
@@ -530,19 +532,21 @@ static int ntfs_write_block(struct page *page, struct writeback_control *wbc)
BUG_ON
(
!
PageUptodate
(
page
));
create_empty_buffers
(
page
,
blocksize
,
(
1
<<
BH_Uptodate
)
|
(
1
<<
BH_Dirty
));
if
(
unlikely
(
!
page_has_buffers
(
page
)))
{
ntfs_warning
(
vol
->
sb
,
"Error allocating page "
"buffers. Redirtying page so we try "
"again later."
);
/*
* Put the page back on mapping->dirty_pages, but leave
* its buffers' dirty state as-is.
*/
redirty_page_for_writepage
(
wbc
,
page
);
unlock_page
(
page
);
return
0
;
}
}
bh
=
head
=
page_buffers
(
page
);
if
(
unlikely
(
!
bh
))
{
ntfs_warning
(
vol
->
sb
,
"Error allocating page buffers. "
"Redirtying page so we try again later."
);
/*
* Put the page back on mapping->dirty_pages, but leave its
* buffer's dirty state as-is.
*/
redirty_page_for_writepage
(
wbc
,
page
);
unlock_page
(
page
);
return
0
;
}
BUG_ON
(
!
bh
);
/* NOTE: Different naming scheme to ntfs_read_block()! */
...
...
@@ -910,7 +914,6 @@ static int ntfs_write_mst_block(struct page *page,
sync
=
(
wbc
->
sync_mode
==
WB_SYNC_ALL
);
/* Make sure we have mapped buffers. */
BUG_ON
(
!
page_has_buffers
(
page
));
bh
=
head
=
page_buffers
(
page
);
BUG_ON
(
!
bh
);
...
...
@@ -2397,6 +2400,7 @@ void mark_ntfs_record_dirty(struct page *page, const unsigned int ofs) {
buffers_to_free
=
bh
;
}
bh
=
head
=
page_buffers
(
page
);
BUG_ON
(
!
bh
);
do
{
bh_ofs
=
bh_offset
(
bh
);
if
(
bh_ofs
+
bh_size
<=
ofs
)
...
...
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