zfs-linux / zfs

Native ZFS for Linux

Home Page:http://wiki.github.com/behlendorf/zfs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Newly created file/directory always got 0000 permission when ZFS is used as root filesystem

opened this issue · comments

steps:

  1. create pool
  2. install Linux on the pool with deboopstrap or just copy a working Linux root to the pool
  3. change initrd.img and boot from zfs root
  4. touch /foo
    no one can read/write/execute file /foo. chmod still works. other non-zfs filesystems, or filesystems on another pool don't have this problem.

Hi Yaodec,

Which version of the code did you try this on. Have you seen this in cases other than booting of the root ?

zfs: f0c4bc6
spl: c55fe3343e47fe55a6599d2bd721fdd181037474
lzfs: d1a10ccb6466eef5b79d650611f4f6b891062c6b
Only saw this case on the root pool, and every file system on the root pool got this problem.

I'm getting the same issue on all of my ZFS filesystems. As mentioned earlier, Fedora 14 x86_64, with the new ZFS releases.

Could you try the following and see if that works ?

zfs set aclmode=discard

aclmode doesn't show up as an actual option under zfs set or zfs get. Should I upgrade the pool?

I get the same behavior, newly created files gets a 0000 permission but it is possible to chmod the file/directory and set permissions. Ubuntu 10.04 LTS server with ZFS built from source pulled yesterday.

After some more testing I noticed that this only happens in my old filesystems, i.e. those created using beta03. Any new filesystems I create is version 5 and new files or directories in those gets the correct permissions.

All old filesystems however are version 4, and if I try to upgrade to version 5 nothing happens apart from stack traces in kern.log:

Jan 23 11:10:02 gunhed kernel: [3019941.383950] SPL: Showing stack for process 21391
Jan 23 11:10:02 gunhed kernel: [3019941.383956] Pid: 21391, comm: zfs Tainted: P 2.6.32-25-server #45-Ubuntu
Jan 23 11:10:02 gunhed kernel: [3019941.383959] Call Trace:
Jan 23 11:10:02 gunhed kernel: [3019941.383973] [] spl_debug_dumpstack+0x27/0x40 [spl]
Jan 23 11:10:02 gunhed kernel: [3019941.383983] [] kmem_alloc_debug+0x11d/0x130 [spl]
Jan 23 11:10:02 gunhed kernel: [3019941.384023] [] zfs_prop_set_special+0x23e/0x3c0 [zfs]
Jan 23 11:10:02 gunhed kernel: [3019941.384030] [] ? zprop_get_proptable+0x13/0x30 [zcommon]
Jan 23 11:10:02 gunhed kernel: [3019941.384068] [] zfs_set_prop_nvlist+0x192/0x6d0 [zfs]
Jan 23 11:10:02 gunhed kernel: [3019941.384106] [] zfs_ioc_set_prop+0x7b/0x140 [zfs]
Jan 23 11:10:02 gunhed kernel: [3019941.384143] [] ? spa_open+0x13/0x20 [zfs]
Jan 23 11:10:02 gunhed kernel: [3019941.384180] [] zfsdev_ioctl+0xef/0x1c0 [zfs]
Jan 23 11:10:02 gunhed kernel: [3019941.384186] [] vfs_ioctl+0x22/0xa0
Jan 23 11:10:02 gunhed kernel: [3019941.384191] [] ? do_brk+0x25c/0x340
Jan 23 11:10:02 gunhed kernel: [3019941.384195] [] do_vfs_ioctl+0x81/0x410
Jan 23 11:10:02 gunhed kernel: [3019941.384200] [] ? do_page_fault+0x153/0x3b0
Jan 23 11:10:02 gunhed kernel: [3019941.384204] [] sys_ioctl+0x81/0xa0
Jan 23 11:10:02 gunhed kernel: [3019941.384209] [] system_call_fastpath+0x16/0x1b

As before, Ubuntu 10.04 LTS with kernel 2.6.32-25-server and zfs build from source pulled on friday 21/1.

with the ubuntu 2.6.35-22-server binary downloaded from kqstor, i still got this problem :-(. my pool wasn't created under linux but mac os x, pool version is 8. i also tried command "zfs set aclmode=discard", but i got an "invalid property" error.
i tried some old beta binaries and also tried to compile from source, but only the ubuntu beta03 binary could handle file permissions correctly on the pool. what interesting is that with the beta03 binary i can set/get the aclmode property.

currently we don't support using pool create in fuser/bsd or opensolaris, this is a configuration know to cause trouble.