Josef Bacik
2013-Jul-31 14:29 UTC
[PATCH] Btrfs: don''t bug_on when we fail when cleaning up transactions
There is no reason for this sort of jackassery. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com> --- fs/btrfs/transaction.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 18f7e71..ea8d522 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1942,6 +1942,5 @@ int btrfs_clean_one_deleted_snapshot(struct btrfs_root *root) * If we encounter a transaction abort during snapshot cleaning, we * don''t want to crash here */ - BUG_ON(ret < 0 && ret != -EAGAIN && ret != -EROFS); - return 1; + return (ret < 0) ? 0 : 1; } -- 1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
David Sterba
2013-Aug-01 17:50 UTC
Re: [PATCH] Btrfs: don''t bug_on when we fail when cleaning up transactions
On Wed, Jul 31, 2013 at 10:29:23AM -0400, Josef Bacik wrote:> There is no reason for this sort of jackassery. Thanks, > > Signed-off-by: Josef Bacik <jbacik@fusionio.com> > --- > fs/btrfs/transaction.c | 3 +-- > 1 files changed, 1 insertions(+), 2 deletions(-) > > diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c > index 18f7e71..ea8d522 100644 > --- a/fs/btrfs/transaction.c > +++ b/fs/btrfs/transaction.c > @@ -1942,6 +1942,5 @@ int btrfs_clean_one_deleted_snapshot(struct btrfs_root *root) > * If we encounter a transaction abort during snapshot cleaning, we > * don''t want to crash here > */ > - BUG_ON(ret < 0 && ret != -EAGAIN && ret != -EROFS); > - return 1; > + return (ret < 0) ? 0 : 1;The reason was to let known harmless error codes pass and catch the unexpected ones, but the whitelist was incomplete and I guess you''ve seen something like ENOMEM or EIO. As the cleaning process is restartable I''m ok with removing the bugon. Reviewed-by: David Sterba <dsterba@suse.cz> -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html