[PVFS-developers] metadata file size checking
Rob Ross
rross at mcs.anl.gov
Fri May 14 14:10:38 EDT 2004
Hi Don,
Are you sure that you want to do that? The way the symlinks work, you
want to get the stats on the target, not on the link itself...
Right?
BTW I came up with what I thought was a clever way to avoid the extra
stat() call, which was to modify meta_read() to read into a temporary
buffer that is a few bytes larger than the actual structure. Then you can
check that the read return value is actually the size of the structure and
do a memcpy() to get the data into the final location.
This is all good, but it moves the failure cases into more obscure spots,
so I think that your approach is probably better. I still hate to see us
add additional syscalls though. Anyway, once we've agreed on whether or
not that should be an lstat() I'll get to applying...
Thanks,
Rob
On Thu, 13 May 2004, Don Porter wrote:
> Err, make that stat in metaopen an lstat (not stat) or some symlinks
> might not work.
>
> Thanks,
> don
>
> On Thu, 2004-05-06 at 17:11, Rob Ross wrote:
> > Hi Don,
> >
> > Any feel for the overhead of doing this on every open/create?
> >
> > Thanks,
> >
> > Rob
> >
> > Porter Don wrote:
> > > Greetings all,
> > >
> > > I wanted to implement some protection against overwriting a metadata file
> > > that has not had the migration script run on it after an upgrade. So I
> > > ended up stat-ing the file in meta-open and if it is not a directory and its
> > > size is not the same as a struct fmeta, then the manager will return an
> > > EINVAL (open to suggestions for better error code) and print a message to
> > > logs. See below:
> >
> > [snip]
> >
> > > Thanks and let me know what you all think,
> > > don
More information about the PVFS-developers
mailing list