diff mbox

[2/7] UBIFS: do not treat ENOSPC specially

Message ID 1281169577-18664-3-git-send-email-dedekind1@gmail.com
State New, archived
Headers show

Commit Message

Artem Bityutskiy Aug. 7, 2010, 8:26 a.m. UTC
From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

'ubifs_garbage_collect_leb()' should never return '-ENOSPC', and if it
does, this is an error. Thus, do not treat this error code specially.
'-EAGAIN' is a special error code, but not '-ENOSPC'.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
 fs/ubifs/gc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Vitaly Wool Aug. 8, 2010, 5:51 p.m. UTC | #1
Hi Artem,

On Sat, Aug 7, 2010 at 4:26 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
>
> 'ubifs_garbage_collect_leb()' should never return '-ENOSPC', and if it
> does, this is an error. Thus, do not treat this error code specially.
> '-EAGAIN' is a special error code, but not '-ENOSPC'.
>
> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
> ---
>  fs/ubifs/gc.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/ubifs/gc.c b/fs/ubifs/gc.c
> index f89a422..29ce1b3 100644
> --- a/fs/ubifs/gc.c
> +++ b/fs/ubifs/gc.c
> @@ -677,7 +677,7 @@ int ubifs_garbage_collect(struct ubifs_info *c, int anyway)
>
>                ret = ubifs_garbage_collect_leb(c, &lp);
>                if (ret < 0) {
> -                       if (ret == -EAGAIN || ret == -ENOSPC) {
> +                       if (ret == -EAGAIN) {
>                                /*
>                                 * These codes are not errors, so we have to
>                                 * return the LEB to lprops. But if the

(just passing by...) probably the comment should be updated as well?

Thanks,
   Vitaly
Artem Bityutskiy Aug. 9, 2010, 5:56 a.m. UTC | #2
On Sun, 2010-08-08 at 13:51 -0400, Vitaly Wool wrote:
> >                ret = ubifs_garbage_collect_leb(c, &lp);
> >                if (ret < 0) {
> > -                       if (ret == -EAGAIN || ret == -ENOSPC) {
> > +                       if (ret == -EAGAIN) {
> >                                /*
> >                                 * These codes are not errors, so we have to
> >                                 * return the LEB to lprops. But if the
> 
> (just passing by...) probably the comment should be updated as well?

Hi, indeed :-)

Artem.
diff mbox

Patch

diff --git a/fs/ubifs/gc.c b/fs/ubifs/gc.c
index f89a422..29ce1b3 100644
--- a/fs/ubifs/gc.c
+++ b/fs/ubifs/gc.c
@@ -677,7 +677,7 @@  int ubifs_garbage_collect(struct ubifs_info *c, int anyway)
 
 		ret = ubifs_garbage_collect_leb(c, &lp);
 		if (ret < 0) {
-			if (ret == -EAGAIN || ret == -ENOSPC) {
+			if (ret == -EAGAIN) {
 				/*
 				 * These codes are not errors, so we have to
 				 * return the LEB to lprops. But if the