From: Gerd Hoffmann <kraxel@redhat.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
linux-api@vger.kernel.org, aarcange@redhat.com
Subject: Re: [PATCH v4 2/3] Add preadv and pwritev system calls.
Date: Thu, 18 Dec 2008 14:37:57 +0100 [thread overview]
Message-ID: <494A5235.6090502@redhat.com> (raw)
In-Reply-To: <200812181334.33719.arnd@arndb.de>
Hi,
> Please remember to add the function prototypes to
> include/linux/syscalls.h.
Done.
>> +asmlinkage ssize_t
>> +compat_sys_preadv(unsigned long fd, const struct compat_iovec __user *vec,
>> + unsigned long vlen, u32 pos_high, u32 pos_low)
>> +{.
>> + loff_t pos = ((loff_t)pos_high << 32) | pos_low;
>
> This is whitespace damaged, as are the other four functions in the
> same place.
Fixed.
>> + struct file *file;
>> + ssize_t ret = -EBADF;
>> +
>> + if (pos < 0)
>> + return -EINVAL;
>> +
>> + file = fget(fd);
>> + if (!file)
>> + return -EBADF;
>
> Any reason for using fget() here, but fget_light() in sys_preadv?
Due to the new syscalls being derived from the readv()/preadv()
versions, which have the same inconsistency. Dunno why. I'd suspect
the reason is that the compat syscalls tend to be overlooked when the
code is updated. Proof: patch #1 in this series ...
I'll switch them all over in a separate followup patch.
>> + if (!(file->f_mode & FMODE_READ))
>> + goto out;
>> +
>> + ret = -EINVAL;
>> + if (!file->f_op || (!file->f_op->aio_read && !file->f_op->read))
>> + goto out;
>
> Maybe this logic could get moved into a compat_readv() function,
> similar to vfs_readv().
Yes, makes sense.
cheers,
Gerd
next prev parent reply other threads:[~2008-12-18 13:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-18 11:42 [PATCH v4 0/3] System call design: preadv & pwritev Gerd Hoffmann
2008-12-18 11:42 ` [PATCH v4 1/3] Add missing accounting calls to compat_sys_{readv,writev} Gerd Hoffmann
2008-12-18 11:42 ` [PATCH v4 2/3] Add preadv and pwritev system calls Gerd Hoffmann
2008-12-18 12:34 ` Arnd Bergmann
2008-12-18 13:37 ` Gerd Hoffmann [this message]
2008-12-18 11:42 ` [PATCH v4 3/3] MIPS: Add preadv(2) and pwritev(2) syscalls Gerd Hoffmann
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=494A5235.6090502@redhat.com \
--to=kraxel@redhat.com \
--cc=aarcange@redhat.com \
--cc=arnd@arndb.de \
--cc=linux-api@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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