[CRIU] [PATCH 6/9] files-reg: Strip off "(deleted)" postfix on ghost files

Cyrill Gorcunov gorcunov at gmail.com
Fri Oct 17 05:10:47 PDT 2014


On Fri, Oct 17, 2014 at 04:06:56PM +0400, Cyrill Gorcunov wrote:
> On Fri, Oct 17, 2014 at 04:02:29PM +0400, Pavel Emelyanov wrote:
> > 
> > > @@ -623,9 +623,27 @@ static inline bool nfs_silly_rename(char *rpath, const struct fd_parms *parms)
> > >  	return (parms->fs_type == NFS_SUPER_MAGIC) && is_sillyrename_name(rpath);
> > >  }
> > >  
> > > -static int check_path_remap(char *rpath, int plen, const struct fd_parms *parms,
> > > +static void strip_deleted(struct fd_link *link)
> > > +{
> > > +	const char postfix[] = " (deleted)";
> > > +	const size_t plen = strlen(postfix);
> > 
> > Why not the sizeof(postfix) - 1?
> 
> It's the same for constants, gcc is smart enough.

0000000000000080 <strip_deleted>:
	...
      ad:       48 83 fd 0a             cmp    $0xa,%rbp

IIRC it has this kind of behaviour since long-long time ago.


More information about the CRIU mailing list