quotas and small files

Jeremy Allison jeremy at valinux.com
Sat Aug 4 23:52:08 GMT 2001


Matt Zinkevicius wrote:
> 
> From: "Jeremy Allison" <jeremy at valinux.com>
> 
> > Ah ! I've noticed the following in your log....
> >
> > ----------------------------------------------------------
> >   vfs_allocate_file_space: file test5/Test.File 125.txt, grow. Current
> size 0
> >
> >   acldb_vfs_ftruncate: fd=27
> >
> >   push_sec_ctx(506, 50014) : sec_ctx_stack_ndx = 1
> >
> >   setting sec ctx (0, 0) - sec_ctx_stack_ndx = 1
> >
> >   pop_sec_ctx (506, 50014) - sec_ctx_stack_ndx = 0
> >
> >   acldb_vfs_ftruncate: Successful
> > ----------------------------------------------------------
> 
> int acldb_vfs_ftruncate(struct files_struct *fsp, int fd, SMB_OFF_T offset)
> {
>    int result;
> 
>    DEBUG(ACLINFO,("acldb_vfs_ftruncate: fd=%d\n", fd));
> 
>    /* Root wrapper */
>    become_root();
>    result = vfswrap_ftruncate(fsp, fd, offset);
>    unbecome_root();
> 
>    DEBUG(ACLINFO,("acldb_vfs_ftruncate: %s\n", STATUS(result!=-1)));
>    return result;
> }
> 
> Root wrapper avoids connected user's unix security context. I don't
> think this function could be problem, unless become_root() has some
> strange side effects. I'll check...

Ah. But remember the debug may fail and set errno, the unbecome_root
may cause errno to be set.

If you're not saving the errno value from the ftruncate and
restoring before the "return result" then you may get any
old errno returned instead of the correct one if ftruncate
failed, depending on whether other syscall failed.

Jeremy.




More information about the samba-technical mailing list