diff options
| -rw-r--r-- | mm/filemap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/filemap.c b/mm/filemap.c index 000a220e2a41..088358c8006b 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
| @@ -257,9 +257,11 @@ static int filemap_check_errors(struct address_space *mapping) | |||
| 257 | { | 257 | { |
| 258 | int ret = 0; | 258 | int ret = 0; |
| 259 | /* Check for outstanding write errors */ | 259 | /* Check for outstanding write errors */ |
| 260 | if (test_and_clear_bit(AS_ENOSPC, &mapping->flags)) | 260 | if (test_bit(AS_ENOSPC, &mapping->flags) && |
| 261 | test_and_clear_bit(AS_ENOSPC, &mapping->flags)) | ||
| 261 | ret = -ENOSPC; | 262 | ret = -ENOSPC; |
| 262 | if (test_and_clear_bit(AS_EIO, &mapping->flags)) | 263 | if (test_bit(AS_EIO, &mapping->flags) && |
| 264 | test_and_clear_bit(AS_EIO, &mapping->flags)) | ||
| 263 | ret = -EIO; | 265 | ret = -EIO; |
| 264 | return ret; | 266 | return ret; |
| 265 | } | 267 | } |
