From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] fcntl36: fix 32-bit sporadic failures
Date: Tue, 19 Jun 2018 06:56:08 -0400 (EDT) [thread overview]
Message-ID: <667704271.27470650.1529405768650.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <CA+G9fYt1VpwXKj+Zahf39uHopUXxqYdW3BogB0HOATyuf4Bdww@mail.gmail.com>
----- Original Message -----
> On 15 June 2018 at 22:52, Jan Stancek <jstancek@redhat.com> wrote:
> > fcntl36 testcase has been observed to sporadically fail, when
> > running 32-bit user-space on 64-bit kernel.
> >
> > Strace shows that region length is 0 for some commands:
> > fcntl64(6, F_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=5120,
> > l_len=0}
> >
> > This is because testcase is passing struct flock64, but
> > command is F_SETLK, not F_SETLK64.
> >
> > So, kernel treats argument for POSIX command as 32-bit "struct flock":
> >
> > static long do_compat_fcntl64(unsigned int fd, unsigned int cmd,
> > ...
> > case F_SETLK:
> > case F_SETLKW:
> > err = get_compat_flock(&flock, compat_ptr(arg));
> > ...
> >
> > in contrast to F_OFD_* commands, where argument is treated
> > as "struct flock64":
> > case F_SETLK64:
> > case F_SETLKW64:
> > case F_OFD_SETLK:
> > case F_OFD_SETLKW:
> > err = get_compat_flock64(&flock, compat_ptr(arg));
> > ...
> >
> > Switch argument of POSIX commands to 'struct flock' and leave it to
> > glibc to pick correct syscall and command.
> >
> > I tested fcntl36 and fcntl36_64 on x86_64 kernel (as 64bit + 32bit binary)
> > and i386 kernel by running 100 iterations.
> >
> > Signed-off-by: Jan Stancek <jstancek@redhat.com>
>
> Tested-by: Naresh Kamboju <naresh.kamboju@linaro.org>
>
Thanks Li & Naresh. Pushed.
Regards,
Jan
prev parent reply other threads:[~2018-06-19 10:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-15 17:22 [LTP] [PATCH] fcntl36: fix 32-bit sporadic failures Jan Stancek
2018-06-15 18:27 ` Rafael Tinoco
2018-06-15 18:39 ` Jan Stancek
2018-06-16 4:15 ` Li Wang
2018-06-19 7:51 ` Naresh Kamboju
2018-06-19 10:56 ` Jan Stancek [this message]
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=667704271.27470650.1529405768650.JavaMail.zimbra@redhat.com \
--to=jstancek@redhat.com \
--cc=ltp@lists.linux.it \
/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