All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
To: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 2/2-updated] syscalls/fstatfs02: Using temporary file description to test the syscall
Date: Tue, 06 May 2014 15:10:18 +0400	[thread overview]
Message-ID: <5368C31A.2070400@oracle.com> (raw)
In-Reply-To: <5368C0B6.4000307@oracle.com>



On 05/06/2014 03:00 PM, Stanislav Kholmanskikh wrote:
>
>
> On 04/30/2014 02:57 PM, shuang.qiu@oracle.com wrote:
>> From: Shuang Qiu <shuang.qiu@oracle.com>
>>
>> It does not make sense to use stdout as the file description to test the
>> system call fstatfs().We may get unexpected result(i.e.
>> errno=38:Function not implemented) if redirect stdout when running ltp.
>> Using ltp temporary file instead.
>>
>> Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>
>
> The problem is that with the 2.6.39 series of kernels ENOSYS is returned
> where EFAULT is expected.
>
> The reproducer:
> #include <error.h>
> #include <stdio.h>
> #include <unistd.h>
> #include <sys/vfs.h>
>
> int main(void)
> {
>     int fds[2];
>
>     if (pipe(fds) < 0) {
>       perror("pipe() failed");
>       return 1;
>     }
>
>     if (fstatfs(fds[1], (void *)-1) < 0) {
>       perror("fstatfs() failed");
>       return 1;
>     }
>
>     return 0;
> }
>
> With 2.6.18, 2.6.32, 3.8.13 this reproducer returns EFAULT,
> but with 2.6.39 - ENOSYS.
>
> If we change '(void *)-1' to a vaild pointer, fstatfs() + 2.6.39 will
> succeed.
>
> So it's a bug in 2.6.39, which is fixed in modern kernels.
>
>   From one side, the above patch makes fstatfs02 pass by hiding an old
> (and already fixed) kernel bug.
>
> But from the other side, it also enlarges the test scope by allowing to
> test different file systems.
>
> So, personally, I would accept it.

I'm not convinced that it's worth to add a new scenario to test fstatfs 
+ pipe file descriptor + invalid address....

>
> Are there any thoughts about it?
>
> Thanks.
>
> ------------------------------------------------------------------------------
> Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
> &#149; 3 signs your SCM is hindering your productivity
> &#149; Requirements for releasing software faster
> &#149; Expert tips and advice for migrating your SCM now
> http://p.sf.net/sfu/perforce
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
>

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2014-05-06 11:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-30 10:57 [LTP] [PATCH 2/2-updated] syscalls/fstatfs02: Using temporary file description to test the syscall shuang.qiu
2014-05-06 11:00 ` Stanislav Kholmanskikh
2014-05-06 11:10   ` Stanislav Kholmanskikh [this message]
2014-05-29 11:56   ` chrubis

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=5368C31A.2070400@oracle.com \
    --to=stanislav.kholmanskikh@oracle.com \
    --cc=ltp-list@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.