Write-Back failed processing: Handle_write_error

Source: Internet
Author: User

This function handles the return value of the writepage, the Writepage function calls the function that the file system writes, and then returns the state of the write. Through the kernel Source view:

res = mapping->a_ops->writepage (page, &WBC); if (Res < 0) handle_write_error (mapping, page, res); if (res = = writepage_activate) {clearpagereclaim (page); return page _activate;} if (! Pagewriteback (page)) {/* synchronous write or broken A_ops? */clearpagereclaim (page);}

The following is the Handle_write_error function:

Lock_page (page); if (page_mapping (page) = = mapping) {if (Error = =-ENOSPC) set_bit (AS_ENOSPC, &mapping->flags); Elseset_bit (As_eio , &mapping->flags);} Unlock_page (page);

From here we receive an error: ENOSPC no space

As_eio a write error

Suppose a write error has the following conditions: Disk offline, disk line interruption, and so on. But we look at the above, when we find an IO write exception, we do nothing, just simply do the pagewriteback whether it is a write check, if not written, then whether this page can be released, obviously, No.

If the page is neither writable nor freed, it is permanently not recoverable by the system, which causes the physical memory to run out, causing the system to crash abnormally.

Write-Back failed processing: Handle_write_error

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.