Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
88a78a91
Commit
88a78a91
authored
Feb 03, 2014
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'acl_fixes' into linux-next
parents
20b9a902
789b663a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
28 deletions
+24
-28
fs/nfs/nfs3acl.c
fs/nfs/nfs3acl.c
+12
-22
fs/posix_acl.c
fs/posix_acl.c
+12
-6
No files found.
fs/nfs/nfs3acl.c
View file @
88a78a91
...
...
@@ -80,7 +80,7 @@ struct posix_acl *nfs3_get_acl(struct inode *inode, int type)
}
if
(
res
.
acl_access
!=
NULL
)
{
if
(
posix_acl_equiv_mode
(
res
.
acl_access
,
NULL
)
||
if
(
(
posix_acl_equiv_mode
(
res
.
acl_access
,
NULL
)
==
0
)
||
res
.
acl_access
->
a_count
==
0
)
{
posix_acl_release
(
res
.
acl_access
);
res
.
acl_access
=
NULL
;
...
...
@@ -113,7 +113,7 @@ struct posix_acl *nfs3_get_acl(struct inode *inode, int type)
return
ERR_PTR
(
status
);
}
int
nfs3_proc_setacls
(
struct
inode
*
inode
,
struct
posix_acl
*
acl
,
static
int
__
nfs3_proc_setacls
(
struct
inode
*
inode
,
struct
posix_acl
*
acl
,
struct
posix_acl
*
dfacl
)
{
struct
nfs_server
*
server
=
NFS_SERVER
(
inode
);
...
...
@@ -198,6 +198,15 @@ int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl,
return
status
;
}
int
nfs3_proc_setacls
(
struct
inode
*
inode
,
struct
posix_acl
*
acl
,
struct
posix_acl
*
dfacl
)
{
int
ret
;
ret
=
__nfs3_proc_setacls
(
inode
,
acl
,
dfacl
);
return
(
ret
==
-
EOPNOTSUPP
)
?
0
:
ret
;
}
int
nfs3_set_acl
(
struct
inode
*
inode
,
struct
posix_acl
*
acl
,
int
type
)
{
struct
posix_acl
*
alloc
=
NULL
,
*
dfacl
=
NULL
;
...
...
@@ -225,7 +234,7 @@ int nfs3_set_acl(struct inode *inode, struct posix_acl *acl, int type)
if
(
IS_ERR
(
alloc
))
goto
fail
;
}
status
=
nfs3_proc_setacls
(
inode
,
acl
,
dfacl
);
status
=
__
nfs3_proc_setacls
(
inode
,
acl
,
dfacl
);
posix_acl_release
(
alloc
);
return
status
;
...
...
@@ -233,25 +242,6 @@ int nfs3_set_acl(struct inode *inode, struct posix_acl *acl, int type)
return
PTR_ERR
(
alloc
);
}
int
nfs3_proc_set_default_acl
(
struct
inode
*
dir
,
struct
inode
*
inode
,
umode_t
mode
)
{
struct
posix_acl
*
default_acl
,
*
acl
;
int
error
;
error
=
posix_acl_create
(
dir
,
&
mode
,
&
default_acl
,
&
acl
);
if
(
error
)
return
(
error
==
-
EOPNOTSUPP
)
?
0
:
error
;
error
=
nfs3_proc_setacls
(
inode
,
acl
,
default_acl
);
if
(
acl
)
posix_acl_release
(
acl
);
if
(
default_acl
)
posix_acl_release
(
default_acl
);
return
error
;
}
const
struct
xattr_handler
*
nfs3_xattr_handlers
[]
=
{
&
posix_acl_access_xattr_handler
,
&
posix_acl_default_xattr_handler
,
...
...
fs/posix_acl.c
View file @
88a78a91
...
...
@@ -521,8 +521,11 @@ posix_acl_chmod(struct inode *inode, umode_t mode)
return
-
EOPNOTSUPP
;
acl
=
get_acl
(
inode
,
ACL_TYPE_ACCESS
);
if
(
IS_ERR_OR_NULL
(
acl
))
if
(
IS_ERR_OR_NULL
(
acl
))
{
if
(
acl
==
ERR_PTR
(
-
EOPNOTSUPP
))
return
0
;
return
PTR_ERR
(
acl
);
}
ret
=
__posix_acl_chmod
(
&
acl
,
GFP_KERNEL
,
mode
);
if
(
ret
)
...
...
@@ -544,14 +547,15 @@ posix_acl_create(struct inode *dir, umode_t *mode,
goto
no_acl
;
p
=
get_acl
(
dir
,
ACL_TYPE_DEFAULT
);
if
(
IS_ERR
(
p
))
if
(
IS_ERR
(
p
))
{
if
(
p
==
ERR_PTR
(
-
EOPNOTSUPP
))
goto
apply_umask
;
return
PTR_ERR
(
p
);
if
(
!
p
)
{
*
mode
&=
~
current_umask
();
goto
no_acl
;
}
if
(
!
p
)
goto
apply_umask
;
*
acl
=
posix_acl_clone
(
p
,
GFP_NOFS
);
if
(
!*
acl
)
return
-
ENOMEM
;
...
...
@@ -575,6 +579,8 @@ posix_acl_create(struct inode *dir, umode_t *mode,
}
return
0
;
apply_umask:
*
mode
&=
~
current_umask
();
no_acl:
*
default_acl
=
NULL
;
*
acl
=
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment