qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Leon Alrae <leon.alrae@imgtec.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, aurelien@aurel32.net,
	Aleksandar Markovic <aleksandar.markovic@imgtec.com>
Subject: [Qemu-devel] [PULL 8/9] linux-user: Add missing TARGET_EDQUOT error code for Mips
Date: Fri, 23 Sep 2016 08:20:09 +0100	[thread overview]
Message-ID: <1474615210-9006-9-git-send-email-leon.alrae@imgtec.com> (raw)
In-Reply-To: <1474615210-9006-1-git-send-email-leon.alrae@imgtec.com>

From: Aleksandar Markovic <aleksandar.markovic@imgtec.com>

EDQUOT is defined for Mips platform in Linux kernel in such a way
that it has different value than on most other platforms. However,
correspondent TARGET_EDQUOT for Mips is missing in Qemu code. Moreover,
TARGET_EDQUOT is missing from the table for conversion of error codes
from host to target. This patch fixes these problems.

Without this patch, syscalls add_key(), keyctl(), link(), mkdir(), mknod(),
open(), rename(), request_key(), setxattr(), symlink(), and write() will not
be able to return the right error code in some scenarios on Mips platform.
(Some of these syscalls are not yet supported in Qemu, but once they are
supported, they will need correct EDQUOT handling.)

Signed-off-by: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Acked-by: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
---
 linux-user/mips/target_syscall.h   | 2 ++
 linux-user/mips64/target_syscall.h | 2 ++
 linux-user/syscall.c               | 1 +
 3 files changed, 5 insertions(+)

diff --git a/linux-user/mips/target_syscall.h b/linux-user/mips/target_syscall.h
index 6c666dc..0b64b73 100644
--- a/linux-user/mips/target_syscall.h
+++ b/linux-user/mips/target_syscall.h
@@ -221,6 +221,8 @@ struct target_pt_regs {
 #undef TARGET_ENOTRECOVERABLE
 #define TARGET_ENOTRECOVERABLE 166     /* State not recoverable */
 
+#undef TARGET_EDQUOT
+#define TARGET_EDQUOT          1133    /* Quota exceeded */
 
 #define UNAME_MACHINE "mips"
 #define UNAME_MINIMUM_RELEASE "2.6.32"
diff --git a/linux-user/mips64/target_syscall.h b/linux-user/mips64/target_syscall.h
index a9c17f7..6692917 100644
--- a/linux-user/mips64/target_syscall.h
+++ b/linux-user/mips64/target_syscall.h
@@ -218,6 +218,8 @@ struct target_pt_regs {
 #undef TARGET_ENOTRECOVERABLE
 #define TARGET_ENOTRECOVERABLE 166     /* State not recoverable */
 
+#undef TARGET_EDQUOT
+#define TARGET_EDQUOT          1133    /* Quota exceeded */
 
 #define UNAME_MACHINE "mips64"
 #define UNAME_MINIMUM_RELEASE "2.6.32"
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 116e463..0815f30 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -757,6 +757,7 @@ static uint16_t host_to_target_errno_table[ERRNO_TABLE_SIZE] = {
     [ENAVAIL]		= TARGET_ENAVAIL,
     [EISNAM]		= TARGET_EISNAM,
     [EREMOTEIO]		= TARGET_EREMOTEIO,
+    [EDQUOT]            = TARGET_EDQUOT,
     [ESHUTDOWN]		= TARGET_ESHUTDOWN,
     [ETOOMANYREFS]	= TARGET_ETOOMANYREFS,
     [ETIMEDOUT]		= TARGET_ETIMEDOUT,
-- 
2.7.4

  parent reply	other threads:[~2016-09-23  7:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-23  7:20 [Qemu-devel] [PULL 0/9] target-mips queue Leon Alrae
2016-09-23  7:20 ` [Qemu-devel] [PULL 1/9] target-mips: add 24KEc CPU definition Leon Alrae
2016-09-23  7:20 ` [Qemu-devel] [PULL 2/9] target-mips: generate fences Leon Alrae
2016-09-23  7:20 ` [Qemu-devel] [PULL 3/9] linux-user: Fix TARGET_SIOCATMARK definition for Mips Leon Alrae
2016-09-23  7:20 ` [Qemu-devel] [PULL 4/9] linux-user: Fix TARGET_F_GETOWN " Leon Alrae
2016-09-23  7:20 ` [Qemu-devel] [PULL 5/9] linux-user: Fix structure target_flock " Leon Alrae
2016-09-23  7:20 ` [Qemu-devel] [PULL 6/9] linux-user: Fix structure target_semid64_ds " Leon Alrae
2016-09-23  7:20 ` [Qemu-devel] [PULL 7/9] linux-user: Fix certain argument alignment cases for Mips64 Leon Alrae
2016-09-23  7:20 ` Leon Alrae [this message]
2016-09-23  7:20 ` [Qemu-devel] [PULL 9/9] linux-user: Add missing Mips syscalls items in strace.list Leon Alrae
2016-09-23 15:15 ` [Qemu-devel] [PULL 0/9] target-mips queue Peter Maydell

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=1474615210-9006-9-git-send-email-leon.alrae@imgtec.com \
    --to=leon.alrae@imgtec.com \
    --cc=aleksandar.markovic@imgtec.com \
    --cc=aurelien@aurel32.net \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.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).