Hello,

  the attached patch makes reiserfs correctly return EDQUOT when the
allocation failed due to quotas (so far we just returned ENOSPC).
Please apply.

                                                                Honza
Return correct error code if allocation failed.

Signed-off-by: Jan Kara <[EMAIL PROTECTED]>

diff -rupX /home/jack/.kerndiffexclude linux-2.6.14-rc5/fs/reiserfs/file.c 
linux-2.6.14-rc5-1-reiser_error_return/fs/reiserfs/file.c
--- linux-2.6.14-rc5/fs/reiserfs/file.c 2005-10-25 08:53:25.000000000 +0200
+++ linux-2.6.14-rc5-1-reiser_error_return/fs/reiserfs/file.c   2005-11-07 
08:29:38.000000000 +0100
@@ -251,12 +251,12 @@ static int reiserfs_allocate_blocks_for_
                                                       blocks_to_allocate,
                                                       blocks_to_allocate);
                        if (res != CARRY_ON) {
-                               res = -ENOSPC;
+                               res = res == QUOTA_EXCEEDED ? -EDQUOT : -ENOSPC;
                                pathrelse(&path);
                                goto error_exit;
                        }
                } else {
-                       res = -ENOSPC;
+                       res = res == QUOTA_EXCEEDED ? -EDQUOT : -ENOSPC;
                        pathrelse(&path);
                        goto error_exit;
                }

Reply via email to