Add errors=continue
PATCH 1/3 Add errors=continue
OCFS2 is often used in high-availaibility systems. However, ocfs2 converts the filesystem to read-only at the drop of the hat. This may not be necessary, since turning the filesystem read-only would affect other running processes as well, decreasing availability.
This attempt is to add errors=continue, which would return the EIO to the calling process and terminate furhter processing so that the filesystem is not corrupted further. However, the filesystem is not converted to read-only.
As a future plan, I intend to create a small utility or extend fsck.ocfs2 to fix small errors such as in the inode. The input to the utility such as the inode can come from the kernel logs so we don't have to schedule a downtime for fixing small-enough errors.
The patch changes the ocfs2_error to return an error. The error returned depends on the mount option set. If none is set, the default is to turn the filesystem read-only.
Perhaps errors=continue is not the best option name. Historically it is used for making an attempt to progress in the current process itself. Should we call it errors=eio? or errors=killproc? Suggestions/Comments welcome.
Sources are available at:
https://github.com/goldwynr/linux/tree/error-cont
--- fs/ocfs2/ocfs2.h | 2 ++ fs/ocfs2/super.c | 57 +++++++++++++++++++++++++++++++++++++++++--------------- fs/ocfs2/super.h | 2 +- 3 files changed, 45 insertions(+), 16 deletions(-)
fs/ocfs2/ocfs2.h +2 -0
@@ -286,6 +286,8 @@ enum ocfs2_mount_optionsOCFS2_MOUNT_HB_GLOBAL =1 <<14 ,/* Global heartbeat */ OCFS2_MOUNT_JOURNAL_ASYNC_COMMIT =1 <<15 ,/* Journal Async Commit */ +OCFS2_MOUNT_ERRORS_CONT =1 <<16 ,/* Return EIO to the calling process on error */ + OCFS2_MOUNT_ERRORS_ROFS = 1 << 17, /* Change filesystem to read-only on error */ };#define OCFS2_OSB_SOFT_RO 0x0001
fs/ocfs2/super.c +42 -15
110 lines not on this page · raw message
fs/ocfs2/super.h +1 -1
@@ -32,7 +32,7 @@ int ocfs2_publish_get_mount_state(struct ocfs2_super *osb, int node_num); __printf(3, 4) -void __ocfs2_error (struct super_block *sb,const char *function, +int __ocfs2_error (struct super_block *sb,const char *function,const char *fmt, ...); #define ocfs2_error(sb, fmt, args...) __ocfs2_error(sb, __PRETTY_FUNCTION__, fmt, ##args)
Signature · 1 line
2.1.4
PATCH 1/3 Add errors=continue
Hi Goldwyn,
Quoted 10 lines · Goldwyn Rodrigues
OCFS2 is often used in high-availaibility systems. However, ocfs2 converts the filesystem to read-only at the drop of the hat. This may not be necessary, since turning the filesystem read-only would affect other running processes as well, decreasing availability.
This attempt is to add errors=continue, which would return the EIO to the calling process and terminate furhter processing so that the filesystem is not corrupted further. However, the filesystem is not converted to read-only.
Quoted 5 lines
As a future plan, I intend to create a small utility or extend fsck.ocfs2 to fix small errors such as in the inode. The input to the utility such as the inode can come from the kernel logs so we don't have to schedule a downtime for fixing small-enough errors.
I am interested in your thought. As a cluster filesystem, I don't think it is a good idea that we set the whole filesystem to readonly because of a small error (for example, inode OCFS2_VALID_FL not set). It impacts too much. So we can isolate some errors and fix them in the backgroud, without offline fsck.
I think you can send a RFC to discuss this topic.
--
Joseph