Re: [PATCH] Btrfs: bail out gracefully rather than BUG_ON

2017-11-13 Thread David Sterba
On Mon, Oct 30, 2017 at 11:14:38AM -0600, Liu Bo wrote: > If a file's DIR_ITEM key is invalid (due to memory errors) and gets > written to disk, a future lookup_path can end up with kernel panic due > to BUG_ON(). > > This gets rid of the BUG_ON(), meanwhile output the corrupted key and > return E

Re: [PATCH] Btrfs: bail out gracefully rather than BUG_ON

2017-10-31 Thread Nikolay Borisov
On 31.10.2017 23:51, Liu Bo wrote: > On Tue, Oct 31, 2017 at 10:23:30PM +0200, Nikolay Borisov wrote: >> >> >> On 30.10.2017 19:14, Liu Bo wrote: >>> If a file's DIR_ITEM key is invalid (due to memory errors) and gets >>> written to disk, a future lookup_path can end up with kernel panic due >>>

Re: [PATCH] Btrfs: bail out gracefully rather than BUG_ON

2017-10-31 Thread Liu Bo
On Tue, Oct 31, 2017 at 10:23:30PM +0200, Nikolay Borisov wrote: > > > On 30.10.2017 19:14, Liu Bo wrote: > > If a file's DIR_ITEM key is invalid (due to memory errors) and gets > > written to disk, a future lookup_path can end up with kernel panic due > > to BUG_ON(). > > > > This gets rid of t

Re: [PATCH] Btrfs: bail out gracefully rather than BUG_ON

2017-10-31 Thread Nikolay Borisov
On 30.10.2017 19:14, Liu Bo wrote: > If a file's DIR_ITEM key is invalid (due to memory errors) and gets > written to disk, a future lookup_path can end up with kernel panic due > to BUG_ON(). > > This gets rid of the BUG_ON(), meanwhile output the corrupted key and > return ENOENT if it's inval

Re: [PATCH] Btrfs: bail out gracefully rather than BUG_ON

2017-10-30 Thread Liu Bo
On Mon, Oct 30, 2017 at 11:14:38AM -0600, Liu Bo wrote: > If a file's DIR_ITEM key is invalid (due to memory errors) and gets > written to disk, a future lookup_path can end up with kernel panic due > to BUG_ON(). > > This gets rid of the BUG_ON(), meanwhile output the corrupted key and > return E

[PATCH] Btrfs: bail out gracefully rather than BUG_ON

2017-10-30 Thread Liu Bo
If a file's DIR_ITEM key is invalid (due to memory errors) and gets written to disk, a future lookup_path can end up with kernel panic due to BUG_ON(). This gets rid of the BUG_ON(), meanwhile output the corrupted key and return ENOENT if it's invalid. Signed-off-by: Liu Bo --- The diff doesn't