Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 4839
b: refs/heads/master
c: 149f0c5
h: refs/heads/master
i:
  4837: f861bc8
  4835: 09e05bd
  4831: ac9efee
v: v3
  • Loading branch information
Anton Altaparmakov committed May 5, 2005
1 parent 96d878d commit e3f92d8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 07a4e2da7dd3c9345f84b2552872f9d38c257451
refs/heads/master: 149f0c5200188a43f1fc11ca2fb14d8183013d10
31 changes: 21 additions & 10 deletions trunk/fs/ntfs/aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -1237,19 +1237,30 @@ static int ntfs_write_mst_block(struct page *page,
static int ntfs_writepage(struct page *page, struct writeback_control *wbc)
{
loff_t i_size;
struct inode *vi;
ntfs_inode *ni, *base_ni;
struct inode *vi = page->mapping->host;
ntfs_inode *base_ni = NULL, *ni = NTFS_I(vi);
char *kaddr;
ntfs_attr_search_ctx *ctx;
MFT_RECORD *m;
ntfs_attr_search_ctx *ctx = NULL;
MFT_RECORD *m = NULL;
u32 attr_len;
int err;

BUG_ON(!PageLocked(page));

vi = page->mapping->host;
/*
* If a previous ntfs_truncate() failed, repeat it and abort if it
* fails again.
*/
if (unlikely(NInoTruncateFailed(ni))) {
down_write(&vi->i_alloc_sem);
err = ntfs_truncate(vi);
up_write(&vi->i_alloc_sem);
if (err || NInoTruncateFailed(ni)) {
if (!err)
err = -EIO;
goto err_out;
}
}
i_size = i_size_read(vi);

/* Is the page fully outside i_size? (truncate in progress) */
if (unlikely(page->index >= (i_size + PAGE_CACHE_SIZE - 1) >>
PAGE_CACHE_SHIFT)) {
Expand All @@ -1262,8 +1273,6 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc)
ntfs_debug("Write outside i_size - truncated?");
return 0;
}
ni = NTFS_I(vi);

/* NInoNonResident() == NInoIndexAllocPresent() */
if (NInoNonResident(ni)) {
/*
Expand Down Expand Up @@ -1419,8 +1428,10 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc)
err = 0;
} else {
ntfs_error(vi->i_sb, "Resident attribute write failed with "
"error %i. Setting page error flag.", err);
"error %i.", err);
SetPageError(page);
NVolSetErrors(ni->vol);
make_bad_inode(vi);
}
unlock_page(page);
if (ctx)
Expand Down

0 comments on commit e3f92d8

Please sign in to comment.