lkml.org 
[lkml]   [2003]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] [2/3] writes: use flags in address space
Oliver Xymoron <oxymoron@waste.org> wrote:
>
> Combine mapping->error and ->gfp_mask into ->flags

Some tweaks here too.



- Robustify the logic a bit. At present if writepage() returns an error
which is not -EIO or -ENOSPC we lose track of it.

So instead, treat all unknown errors as -EIO.



fs/mpage.c | 12 ++++++------
mm/vmscan.c | 6 +++---
2 files changed, 9 insertions(+), 9 deletions(-)

diff -puN fs/mpage.c~awe-use-gfp_flags-fixes fs/mpage.c
--- 25/fs/mpage.c~awe-use-gfp_flags-fixes 2003-08-02 03:40:29.000000000 -0700
+++ 25-akpm/fs/mpage.c 2003-08-02 03:40:29.000000000 -0700
@@ -566,10 +566,10 @@ confused:
/*
* The caller has a ref on the inode, so *mapping is stable
*/
- if (*ret == -EIO)
- set_bit(AS_EIO, &mapping->flags);
- else if (*ret == -ENOSPC)
+ if (*ret == -ENOSPC)
set_bit(AS_ENOSPC, &mapping->flags);
+ else
+ set_bit(AS_EIO, &mapping->flags);
out:
return bio;
}
@@ -671,10 +671,10 @@ mpage_writepages(struct address_space *m
test_clear_page_dirty(page)) {
if (writepage) {
ret = (*writepage)(page, wbc);
- if (ret == -EIO)
- set_bit(AS_EIO, &mapping->flags);
- else if (ret == -ENOSPC)
+ if (ret == -ENOSPC)
set_bit(AS_ENOSPC, &mapping->flags);
+ else
+ set_bit(AS_EIO, &mapping->flags);
} else {
bio = mpage_writepage(bio, page, get_block,
&last_block_in_bio, &ret, wbc);
diff -puN mm/vmscan.c~awe-use-gfp_flags-fixes mm/vmscan.c
--- 25/mm/vmscan.c~awe-use-gfp_flags-fixes 2003-08-02 03:40:29.000000000 -0700
+++ 25-akpm/mm/vmscan.c 2003-08-02 03:40:29.000000000 -0700
@@ -252,10 +252,10 @@ static void handle_write_error(struct ad
{
lock_page(page);
if (page->mapping == mapping) {
- if (error == -EIO)
- set_bit(AS_EIO, &mapping->flags);
- else if (error == -ENOSPC)
+ if (error == -ENOSPC)
set_bit(AS_ENOSPC, &mapping->flags);
+ else
+ set_bit(AS_EIO, &mapping->flags);
}
unlock_page(page);
}
_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:47    [W:0.056 / U:1.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site