From: Herbert Poetzl (herbert_at_13thfloor.at)
Date: Mon 29 Mar 2004 - 00:40:20 BST
On Mon, Mar 29, 2004 at 01:08:06AM +0200, Lars Braeuer wrote:
> Herbert Poetzl wrote:
> >>The same listing from inside the vserver ("vserver <name> exec ls -lagn
> >>drwxr-x--- 2 0 0 4096 Nov 19 02:08 service
> >>drwxrwxrwt 3 0 0 8192 Mar 27 19:45 tmp
> >>drwxr-xr-x 14 0 0 4096 Oct 16 11:36 usr
> >>drwxr-xr-x 20 0 0 4096 Oct 15 01:38 var
> >>When updating to the new kernel the files with the long uid's are not
> >>properly mapped anymore. We noticed this because mysql wouldn't start in
> >>any of the 10 vservers on this system. After chown'ing the related
> >>mysql.pid files and directories the mysql server started. But there are
> >>tons of files with wrong uid's left, so this wouldn't be a solution, just
> >>a temporary patch.
> >as I see it, you have two options to migrate to 2.4.25/vs1.27
> >a) change the context tagging of all files to xid=0
> > - this can be done on the 'old' setup by using the
> > old chctx tool, or by touching each file from the
> > host context (xid = 0)
> > - or with tagxid disabled, using a small script,
> > reading the uid/gid, cropping them to 16 bits
> > - or by doing an xid agnostic backup (tar, dump)
> >b) converting the partition to the new context tagging
> > - again a small script, reading the uid/gid, splitting
> > it into xid/uid/gid and reassembling them to one of
> > the newer formats ...
> So I would get the xid by dividing uid and gid by 65536, right?
or better shifting it right about 16 bit, yes, and both
should contain the same information (xid) in the upper
16 bits ...
> What would be the right formula for reassembling the id's for vs1.27 +
currently the best format would probably be UID24/GID24
#define XIDINO_UID(uid, xid) (((uid) & 0xFFFFFF) | (((xid) & 0xFF00) << 16))
#define XIDINO_GID(gid, xid) (((gid) & 0xFFFFFF) | (((xid) & 0x00FF) << 24))
which basically means that the upper 8 bit of (16 bit) xid
go into the upper 8 bit of the (32 bit) uid, and the lower
8 bit of the xid, into the upper 8 bit of the (32 bit) gid
but probably simpler would be the transition to UID32/GID16
because in this setup, you only have to mask the 'old' uid
to 16 bit, and leave the gid untouched ...
> In a posting I read about three different xid tagging
> methods: UID32/GID16, UID24/GID24 and UID32/GID32.
> I couldn't find a hint when looking at the latest quota patch.
it is defined in include/linux/vxid.h
Vserver mailing list