[LU-2463] posix test_1: mkfifo.3 and umask.2 failed Created: 11/Dec/12  Updated: 20/Dec/12  Resolved: 20/Dec/12

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.4.0, Lustre 2.1.4
Fix Version/s: Lustre 2.4.0, Lustre 2.1.4

Type: Bug Priority: Blocker
Reporter: Jian Yu Assignee: Lai Siyao
Resolution: Fixed Votes: 0
Labels: None
Environment:

Lustre Branch: b2_1
Lustre Build: http://build.whamcloud.com/job/lustre-b2_1/150/
Distro/Arch: RHEL6.3/x86_64 (kernel version: 2.6.32-279.14.1.el6)
Network: TCP (1GigE)
Baseline: ext4


Severity: 3
Rank (Obsolete): 5808

 Description   

The POSIX compliance testing failed as follows:

POSIX failures: 2

Test Name                   Baseline   Lustre Report
mkfifo.3                   Succeeded          Failed
umask.2                    Succeeded          Failed

FAILURE DESCRIPTIONS:

####################################################
Test Name: mkfifo.3 Failed

	Test Description:
A call to mkfifo() creates a new FIFO special file with file
permission bits determined by the mode parameter and the file creation
mask and returns a value of zero.
Posix Ref: Component MKFIFO Assertion 5.4.2.2-25(A)

	Test Strategy:
CREATE child process using cppair() - (genlib)
  SET process creation file mode to S_IRUSR|I_IWGRP|S_IXOTH using
  umask()
  FOR each of the access modes: S_IRWXU|S_IRWXG|S_IRWXO,
  S_IXUSR|S_IWGRP|S_ROTH and S_IRUSR|S_IWGRP|S_IXOTH
    IF FIFO already exists (eaccess()) then remove() it
    CREATE FIFO using mkfifo()
    VERIFY that mkfifo() returned 0 and errno was not set
    VERIFY that the new file is a FIFO using S_ISFIFO(st_mode)

	Test Information:
mkfifo("mkfifo-t.3", 0777) with umask = 0421 set permissions incorrectly
expected: 0356, observed: 0777
mkfifo("mkfifo-t.3", 0124) with umask = 0421 set permissions incorrectly
expected: 0104, observed: 0124
mkfifo("mkfifo-t.3", 0421) with umask = 0421 set permissions incorrectly
expected: 0, observed: 0421

####################################################
Test Name: umask.2 Failed

	Test Description:
A call to umask(cmask) sets the file mode creation mask argument cmask
to turn off permission bits in the mode argument supplied by
open(path, flags, mode), creat(path, mode), mkdir(path, mode), and
mkfifo(path, mode).
Posix Ref: Component UMASK Assertion 5.3.3.2-05(A)

	Test Strategy:
FOR each mode in a list of access modes:
  SET file mode creation mask using umask() with current mode
  FOR each of the functions open(), creat(), mkdir() and mkfifo()
    REMOVE file using remove()
    VERIFY that the file nolonger exists using eaccess() - (genlib)
    CALL current function
    VERIFY that the current function returned successfully
    OBTAIN file status information using stat()
    VERIFY that st_mode matches the current mode
REMOVE file using remove()

	Test Information:
umask(0400) did not set file creation mask correctly
mkfifo("umask-t.2", 0777) created file with permissions 0777, expected
	0377
mkfifo("umask-t.2", 0421) created file with permissions 0421, expected
	021
umask(0200) did not set file creation mask correctly
mkfifo("umask-t.2", 0777) created file with permissions 0777, expected
	0577
umask(0100) did not set file creation mask correctly
mkfifo("umask-t.2", 0777) created file with permissions 0777, expected
	0677
umask(040) did not set file creation mask correctly
mkfifo("umask-t.2", 0777) created file with permissions 0777, expected
	0737
umask(020) did not set file creation mask correctly
mkfifo("umask-t.2", 0777) created file with permissions 0777, expected
	0757
mkfifo("umask-t.2", 0421) created file with permissions 0421, expected
	0401
umask(010) did not set file creation mask correctly
mkfifo("umask-t.2", 0777) created file with permissions 0777, expected
	0767
umask(04) did not set file creation mask correctly
mkfifo("umask-t.2", 0777) created file with permissions 0777, expected
	0773
umask(02) did not set file creation mask correctly
mkfifo("umask-t.2", 0777) created file with permissions 0777, expected
	0775
umask(01) did not set file creation mask correctly
mkfifo("umask-t.2", 0777) created file with permissions 0777, expected
	0776
mkfifo("umask-t.2", 0421) created file with permissions 0421, expected
	0420
umask(0377) did not set file creation mask correctly
mkfifo("umask-t.2", 0777) created file with permissions 0777, expected
	0400
mkfifo("umask-t.2", 0421) created file with permissions 0421, expected
	0400
umask(0577) did not set file creation mask correctly
mkfifo("umask-t.2", 0777) created file with permissions 0777, expected
	0200
mkfifo("umask-t.2", 0421) created file with permissions 0421, expected 0
umask(0677) did not set file creation mask correctly
mkfifo("umask-t.2", 0777) created file with permissions 0777, expected
	0100
mkfifo("umask-t.2", 0421) created file with permissions 0421, expected 0
umask(077) did not set file creation mask correctly
mkfifo("umask-t.2", 0777) created file with permissions 0777, expected
	0700
mkfifo("umask-t.2", 0421) created file with permissions 0421, expected
	0400
umask(0737) did not set file creation mask correctly
mkfifo("umask-t.2", 0777) created file with permissions 0777, expected
	040
mkfifo("umask-t.2", 0421) created file with permissions 0421, expected 0
umask(0757) did not set file creation mask correctly
mkfifo("umask-t.2", 0777) created file with permissions 0777, expected
	020
mkfifo("umask-t.2", 0421) created file with permissions 0421, expected
	020
umask(0767) did not set file creation mask correctly
mkfifo("umask-t.2", 0777) created file with permissions 0777, expected
	010
mkfifo("umask-t.2", 0421) created file with permissions 0421, expected 0
umask(0707) did not set file creation mask correctly
mkfifo("umask-t.2", 0777) created file with permissions 0777, expected
	070
mkfifo("umask-t.2", 0421) created file with permissions 0421, expected
	020
umask(0773) did not set file creation mask correctly
mkfifo("umask-t.2", 0777) created file with permissions 0777, expected
	04
mkfifo("umask-t.2", 0421) created file with permissions 0421, expected 0
umask(0775) did not set file creation mask correctly
mkfifo("umask-t.2", 0777) created file with permissions 0777, expected
	02
mkfifo("umask-t.2", 0421) created file with permissions 0421, expected 0
umask(0776) did not set file creation mask correctly
mkfifo("umask-t.2", 0777) created file with permissions 0777, expected
	01
mkfifo("umask-t.2", 0421) created file with permissions 0421, expected
	01
umask(0770) did not set file creation mask correctly
mkfifo("umask-t.2", 0777) created file with permissions 0777, expected
	07
mkfifo("umask-t.2", 0421) created file with permissions 0421, expected
	01
umask(0777) did not set file creation mask correctly
mkfifo("umask-t.2", 0777) created file with permissions 0777, expected 0
mkfifo("umask-t.2", 0421) created file with permissions 0421, expected 0

Maloo report: https://maloo.whamcloud.com/test_sets/561a3ae4-4399-11e2-a9ca-52540035b04c



 Comments   
Comment by Jian Yu [ 11/Dec/12 ]

MDS_MOUNT_OPTS="-o user_xattr,acl" (for MGS/MDS)
MOUNTOPT="-o user_xattr,acl,flock" (for Client)

Lai, is this related to http://review.whamcloud.com/4660?

Comment by Jian Yu [ 12/Dec/12 ]

MDS_MOUNT_OPTS="-o user_xattr" (for MGS/MDS)
MOUNTOPT="-o user_xattr,flock" (for Client)

The same failure occurred: https://maloo.whamcloud.com/test_sets/a1d65ede-4409-11e2-a9ca-52540035b04c

Comment by Peter Jones [ 12/Dec/12 ]

Minh

Could you please look into this one?

Thanks

Peter

Comment by Minh Diep [ 12/Dec/12 ]

Let's wait to see what Lai says about this. Seems related to his patch

Comment by Lai Siyao [ 12/Dec/12 ]

The cause is that osd_mknod() calls kernel init_special_inode(), which will set inode->i_mode to the mode sent from client, instead we should not touch i_mode here, because it's set in creation time.

I'll commit a fix soon.

Comment by Lai Siyao [ 13/Dec/12 ]

Patch is at http://review.whamcloud.com/#change,4820

Comment by Sarah Liu [ 18/Dec/12 ]

this failure also seen in lustre-master:

https://maloo.whamcloud.com/test_sets/04e08256-4708-11e2-b16f-52540035b04c

Comment by Peter Jones [ 20/Dec/12 ]

Landed for 2.1.4 and 2.4

Generated at Sat Feb 10 01:25:25 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.