diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-27 17:31:44 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-27 17:31:44 -0400 |
| commit | 5b51a7e9d84f19df4d532ebf5624dbb8ad0d6c9c (patch) | |
| tree | aa8359921a8039474c7bb1544823184855e59694 /fs/readdir.c | |
| parent | 3d87ff3e44bd2a13cbe2d2e02cc5e38953ff260f (diff) | |
| parent | 4cdfe84b51420c9ac95c7133da2d4c8a191094af (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
[PATCH] deal with the first call of ->show() generating no output
[PATCH] fix ->llseek() for a bunch of directories
[PATCH] fix regular readdir() and friends
[PATCH] fix hpux_getdents()
[PATCH] fix osf_getdirents()
[PATCH] ntfs: use d_add_ci
[PATCH] change d_add_ci argument ordering
[PATCH] fix efs_lookup()
[PATCH] proc: inode number fixlet
Diffstat (limited to 'fs/readdir.c')
| -rw-r--r-- | fs/readdir.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/readdir.c b/fs/readdir.c index 4e026e5407fb..93a7559bbfd8 100644 --- a/fs/readdir.c +++ b/fs/readdir.c | |||
| @@ -80,8 +80,10 @@ static int fillonedir(void * __buf, const char * name, int namlen, loff_t offset | |||
| 80 | if (buf->result) | 80 | if (buf->result) |
| 81 | return -EINVAL; | 81 | return -EINVAL; |
| 82 | d_ino = ino; | 82 | d_ino = ino; |
| 83 | if (sizeof(d_ino) < sizeof(ino) && d_ino != ino) | 83 | if (sizeof(d_ino) < sizeof(ino) && d_ino != ino) { |
| 84 | buf->result = -EOVERFLOW; | ||
| 84 | return -EOVERFLOW; | 85 | return -EOVERFLOW; |
| 86 | } | ||
| 85 | buf->result++; | 87 | buf->result++; |
| 86 | dirent = buf->dirent; | 88 | dirent = buf->dirent; |
| 87 | if (!access_ok(VERIFY_WRITE, dirent, | 89 | if (!access_ok(VERIFY_WRITE, dirent, |
| @@ -155,8 +157,10 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, | |||
| 155 | if (reclen > buf->count) | 157 | if (reclen > buf->count) |
| 156 | return -EINVAL; | 158 | return -EINVAL; |
| 157 | d_ino = ino; | 159 | d_ino = ino; |
| 158 | if (sizeof(d_ino) < sizeof(ino) && d_ino != ino) | 160 | if (sizeof(d_ino) < sizeof(ino) && d_ino != ino) { |
| 161 | buf->error = -EOVERFLOW; | ||
| 159 | return -EOVERFLOW; | 162 | return -EOVERFLOW; |
| 163 | } | ||
| 160 | dirent = buf->previous; | 164 | dirent = buf->previous; |
| 161 | if (dirent) { | 165 | if (dirent) { |
| 162 | if (__put_user(offset, &dirent->d_off)) | 166 | if (__put_user(offset, &dirent->d_off)) |
