2.1.60 ext2: pls explain "pos = *ppos; if (pos != *ppos) ..."

Peter Moulder (reiter@netspace.net.au)
28 Oct 1997 18:31:05 +1100


Among the diffs for fs/ext2/file.c is:

@@ -163,8 +164,12 @@

if (filp->f_flags & O_APPEND)
pos = inode->i_size;
- else
- pos = filp->f_pos;
+ else {
+ pos = *ppos;
+ if (pos != *ppos)
+ return -EINVAL;
+ }
+
/* Check for overflow.. */
if (pos > (__u32) (pos + count)) {
count = ~pos; /* == 0xFFFFFFFF - pos */

I don't see anything like this in any of the other filesystems in this
patch. Is this a mistake? If not, what's so magical about *ppos that
it's worth testing against its value a cycle ago?

pjm.