From: Sripathi Kodi <sripathik@in.ibm.com>
To: schwidefsky@de.ibm.com, linux390@de.ibm.com,
linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@osdl.org>
Subject: [PATCH] s390: getdents patch for 32 -> 64 converter
Date: Tue, 01 Feb 2005 15:12:48 +0530 [thread overview]
Message-ID: <41FF4F18.90008@in.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 472 bytes --]
Hi,
This patch solves a problem with working of getdents while using 32 bit
binaries on 64 bit Linux/390. glibc expects d_type to be passed if we
have a kernel version after 2.6.4, so we have to also handle it in the
32bit syscall converter. Similar patch was given for PPC by Marcus
Meissner
(http://ozlabs.org/pipermail/linuxppc64-dev/2004-March/001359.html) and
was integrated into 2.6.5.
Thanks,
Sripathi.
Signed-off-by: Sripathi Kodi <sripathik@in.ibm.com>
[-- Attachment #2: filldir_2.6.10_patch.patch --]
[-- Type: text/plain, Size: 863 bytes --]
--- linux-2.6.10/arch/s390/kernel/compat_linux.c 2004-12-25 03:05:24.000000000 +0530
+++ /home/sripathi/12795/mainline/compat_linux.c 2005-02-01 14:06:33.000000000 +0530
@@ -433,7 +433,7 @@ static int filldir(void * __buf, const c
{
struct linux_dirent32 * dirent;
struct getdents_callback32 * buf = (struct getdents_callback32 *) __buf;
- int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1);
+ int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 2);
buf->error = -EINVAL; /* only used if we fail.. */
if (reclen > buf->count)
@@ -447,6 +447,7 @@ static int filldir(void * __buf, const c
put_user(reclen, &dirent->d_reclen);
copy_to_user(dirent->d_name, name, namlen);
put_user(0, dirent->d_name + namlen);
+ put_user(d_type, (char *) dirent + reclen - 1);
buf->current_dir = ((void *)dirent) + reclen;
buf->count -= reclen;
return 0;
next reply other threads:[~2005-02-01 9:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-01 9:42 Sripathi Kodi [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-02-02 14:36 [PATCH] s390: getdents patch for 32 -> 64 converter Martin Schwidefsky
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=41FF4F18.90008@in.ibm.com \
--to=sripathik@in.ibm.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux390@de.ibm.com \
--cc=schwidefsky@de.ibm.com \
/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