linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: Denis Karpov <ext-denis.2.karpov@nokia.com>
Cc: axboe@kernel.dk, akpm@linux-foundation.org,
	hirofumi@mail.parknet.co.jp, linux-ext4@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	adrian.hunter@nokia.com, artem.bityutskiy@nokia.com
Subject: Re: [PATCH 0/4] FS: userspace notification of errors
Date: Wed, 03 Jun 2009 10:36:58 -0500	[thread overview]
Message-ID: <4A26989A.3030300@redhat.com> (raw)
In-Reply-To: <1244041518-32229-1-git-send-email-ext-denis.2.karpov@nokia.com>

Denis Karpov wrote:
> Hello, 
> 
> these patches are resent (a bit re-worked and separated from other stuff).
> The issue was discussed here:
> http://marc.info/?l=linux-fsdevel&m=124402900920380&w=2
> 
> Summary:
> 
> 1. Generic mechanism for notifications of user space about file system's
>    errors/inconsistency on a particular partition using:
> 
>      - sysfs entry /sys/block/<bdev>/<part>/fs_unclean
>      - uevent KOBJ_CHANGE, uevent's environment variable FS_UNCLEAN=[0:1]

My first thought here, just at a very high level, is that fs_errors
rather than fs_unclean may be more accurate; at least in my filesystem
developer world, an "unclean" filesystem is one that was not unmounted
cleanly, not one with ... errors.  "fs_errors"  (or fs_has_errors?)
would also be more in sync with ext3's "errors=" mount options...

>    Userspace might want to monitor these notifications (poll2() on sysfs 
>    file or udevd's rule for uevent) and fix the fs damage.
>    Filesystem can be marked clean again by writing '0' to the 
>    corresponding 'fs_unclean' sysfs file.

It seems a little odd to me that you can just clear this error condition
without necessarily fixing the actual error, but I don't know how else
it should be done....

For ext2/3/4, the fs is -marked- with errors in the superblock, so when
it mounts with that error flag cleared (by fsck), the mount itself could
clear this error condition perhaps?  Maybe it could be the filesystem's
choice whether the error condition is clearable from userspace?

It's also possible that the error was encountered in memory rather than
from on-disk, so it might be nice to differentiate somehow, at least for
filesystems which can do this.  I'm thinking here of "I read something
from disk that was supposed to be an inode but it had the wrong magic
number" vs. "I hit a programming error that caused the transaction
subsystem to get into a state where the filesystem had to shut down" -
in the latter case, fsck is not going to resolve it...

Thanks,
-Eric

>    Currently some file systems remount themselves r/o on critical errors
>    (*FAT; EXT2 depending on 'errors' mount option), userspace is generally
>    unaware of such events. This feature will allow user space to become 
>    aware of possible file system problems and do something about them 
>    (e.g. run fsck automatically or with user's consent).
>    [PATCH 1]
> 
> 2. Make FAT and EXT2 file systems use the above mechanism to optionally
>    notify user space about errors. Implemented as 'notify' mount option
>    (PATCH 3,4).
>    FAT error reporting facilities had to be re-factored (PATCH 2) in 
>    order to simplify sending error notifications.
> 
> Adrian Hunter and Artem Bityutskiy provided input and ideas on implementing
> these features.
> 
> Denis Karpov.

  parent reply	other threads:[~2009-06-03 15:37 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-03 15:05 [PATCH 0/4] FS: userspace notification of errors Denis Karpov
2009-06-03 15:05 ` [PATCH 1/4] FS: filesystem corruption notification Denis Karpov
2009-06-03 15:05   ` [PATCH 2/4] FAT: generalize errors and warning printing Denis Karpov
2009-06-03 15:05     ` [PATCH 3/4] FAT: add 'notify' mount option Denis Karpov
2009-06-03 15:05       ` [PATCH 4/4] EXT2: " Denis Karpov
2009-06-03 19:00         ` Andrew Morton
2009-06-10 21:03         ` Pavel Machek
2009-06-03 18:59       ` [PATCH 3/4] FAT: " Andrew Morton
2009-06-03 18:58   ` [PATCH 1/4] FS: filesystem corruption notification Andrew Morton
2009-06-03 15:36 ` Eric Sandeen [this message]
2009-06-03 18:56 ` [PATCH 0/4] FS: userspace notification of errors Andrew Morton
2009-06-04  1:59   ` Jamie Lokier
2009-06-04  5:57   ` Artem Bityutskiy
2009-06-04 14:27     ` Denis Karpov
2009-06-10 21:05     ` Pavel Machek
2009-06-04 12:53   ` Kay Sievers
2009-06-04 14:29     ` Russell Cattelan
2009-06-05  7:25     ` Jon Masters
2009-06-05 11:07     ` Artem Bityutskiy
2009-06-05 11:51       ` Denis Karpov
2009-06-05 13:06         ` Kay Sievers
     [not found]         ` <ac3eb2510906050606u7527654dv789364549b36f3e7@mail.gmail.com>
2009-06-09 13:49           ` Jan Kara
2009-06-03 22:30 ` Jan Kara
2009-06-04  6:10   ` Artem Bityutskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A26989A.3030300@redhat.com \
    --to=sandeen@redhat.com \
    --cc=adrian.hunter@nokia.com \
    --cc=akpm@linux-foundation.org \
    --cc=artem.bityutskiy@nokia.com \
    --cc=axboe@kernel.dk \
    --cc=ext-denis.2.karpov@nokia.com \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).