On Wed, 07/10 18:25, Fam Zheng wrote:
> > +
> > + if (backing_file) {
> > + /* Check if file exists. */
> > + if (access(filename, F_OK)) {
> > + inode = -1;
> > + } else {
> > + if (stat(filename, &sbuf) == -1) {
> > + error_report("Get file %s stat failed.", filename);
> > + goto err;
> > + }
> > + inode = (long)sbuf.st_ino;
> > + }
> > +
> > + filename = backing_file;
> > + fmt = backing_format;
> > + g_hash_table_insert(inodes, (gpointer)&inode, NULL);
> > + }
> > +
> > + while (filename && (filename[0] != '\0')) {
> > + if (stat(filename, &sbuf) == -1) {
> Does it mean stat() on backing_file twice if it's not NULL? As you
> assigned backing_file to filename above.
I was wrong, the first stat() is on filename. Please ignore this noise.