Re: [PATCH] cifs: wait for tcon resource_id before getting fscache super

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 6, 2021 at 7:22 PM David Howells <dhowells@xxxxxxxxxx> wrote:
>
> Shyam Prasad N <nspmangalore@xxxxxxxxx> wrote:
>
> > @@ -1376,6 +1376,13 @@ struct inode *cifs_root_iget(struct super_block *sb)
> >   inode = ERR_PTR(rc);
> >   }
> >
> > + /*
> > + * The cookie is initialized from volume info returned above.
> > + * Inside cifs_fscache_get_super_cookie it checks
> > + * that we do not get super cookie twice.
> > + */
> > + cifs_fscache_get_super_cookie(tcon);
>
> Ummm...  Does this handle the errors correctly?  What happens if rc != 0 at
> this point and the inode has been marked failed?  It looks like it will
> abandon creation of the superblock without cleaning up the super cookie.
> Maybe - or maybe it can't happen because of the:
>
>         iget_no_retry:
>                 if (!inode) {
>                         inode = ERR_PTR(rc);
>                         goto out;
>                 }
>
> check - but then why is rc being checked?
>
> > +
> >  out:
> >   kfree(path);
> >   free_xid(xid);
>
> David
>

Thanks David. I think that there still needs to be more error handling here.
I'll check on this and send out another patch.

-- 
Regards,
Shyam



[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux