Commit 928c176c authored by Stephen Lord's avatar Stephen Lord

[XFS] prevent readdir from returning offsets of more than 2^31, these

confuse user space. This limits the maximum amount of names in
a directory on linux to 2Gbytes, which should not be a problem.

SGI Modid: 2.5.x-xfs:slinx:135044a
parent 54c4164c
...@@ -274,14 +274,14 @@ linvfs_readdir( ...@@ -274,14 +274,14 @@ linvfs_readdir(
goto done; goto done;
} }
size -= dbp->d_reclen; size -= dbp->d_reclen;
curr_offset = (loff_t)dbp->d_off; curr_offset = (loff_t)dbp->d_off & 0x7fffffff;
dbp = nextdp(dbp); dbp = nextdp(dbp);
} }
} }
done: done:
if (!error) { if (!error) {
if (size == 0) if (size == 0)
filp->f_pos = uio.uio_offset; filp->f_pos = uio.uio_offset & 0x7fffffff;
else if (dbp) else if (dbp)
filp->f_pos = curr_offset; filp->f_pos = curr_offset;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment