Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\attr.c Create Date:2022-07-28 20:08:14
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:y_change - modify attributes of a filesytem object*@dentry: object affected*@attr: new attributes*@delegated_inode: returns inode, if the inode is delegated* The caller must hold the i_mutex on the affected object

Proto:int notify_change(struct dentry *dentry, struct iattr *attr, struct inode **delegated_inode)

Type:int

Parameter:

TypeParameterName
struct dentry *dentry
struct iattr *attr
struct inode **delegated_inode
225  inode = Where the name belongs to - NULL is * negative
226  mode = i_mode
229  ia_valid = ia_valid
231  WARN_ON_ONCE(!inode_is_locked(inode))
233  If ia_valid & ( Attribute flags. These should be or-ed together to figure out what* has been changed! | ATTR_UID | ATTR_GID | ATTR_TIMES_SET) Then
234  If IS_IMMUTABLE(inode) || IS_APPEND(inode) Then Return -EPERM
242  If ia_valid & ATTR_TOUCH Then
243  If IS_IMMUTABLE(inode) Then Return -EPERM
248  If error Then Return error
253  If ia_valid & Attribute flags. These should be or-ed together to figure out what* has been changed! Then
254  amode = ia_mode
256  If is_sxid(amode) Then i_flags &= ~ suid or xattr security attributes
260  now = rrent_time - Return FS time*@inode: inode.* Return the current time truncated to the time granularity supported by* the fs.* Note that inode and inode->sb cannot be NULL.* Otherwise, the function warns and returns time without truncation.
262  ia_ctime = now
263  If Not (ia_valid & ATTR_ATIME_SET) Then ia_atime = now
265  Else ia_atime = mestamp_truncate - Truncate timespec to a granularity*@t: Timespec*@inode: inode being updated* Truncate a timespec to the granularity supported by the fs* containing the inode. Always rounds down. gran must
267  If Not (ia_valid & ATTR_MTIME_SET) Then ia_mtime = now
269  Else ia_mtime = mestamp_truncate - Truncate timespec to a granularity*@t: Timespec*@inode: inode being updated* Truncate a timespec to the granularity supported by the fs* containing the inode. Always rounds down. gran must
272  If ia_valid & ATTR_KILL_PRIV Then
273  error = security_inode_need_killpriv(dentry)
274  If error < 0 Then Return error
276  If error == 0 Then ia_valid = ia_valid &= ~ATTR_KILL_PRIV
287  If ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID) && ia_valid & Attribute flags. These should be or-ed together to figure out what* has been changed! Then BUG()
291  If ia_valid & ATTR_KILL_SUID Then
292  If mode & S_ISUID Then
294  ia_mode = i_mode & ~S_ISUID
297  If ia_valid & ATTR_KILL_SGID Then
298  If (mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP) Then
303  ia_mode &= ~S_ISGID
306  If Not (ia_valid & ~(ATTR_KILL_SUID | ATTR_KILL_SGID)) Then Return 0
313  If ia_valid & ATTR_UID && Not kuid_has_mapping(s_user_ns, ia_uid) Then Return -EOVERFLOW
316  If ia_valid & ATTR_GID && Not kgid_has_mapping(s_user_ns, ia_gid) Then Return -EOVERFLOW
323  If Not (ia_valid & ATTR_UID) && Not uid_valid(i_uid) Then Return -EOVERFLOW
325  If Not (ia_valid & ATTR_GID) && Not gid_valid(i_gid) Then Return -EOVERFLOW
328  error = security_inode_setattr(dentry, attr)
329  If error Then Return error
331  error = try_break_deleg(inode, delegated_inode)
332  If error Then Return error
335  If setattr Then error = setattr(dentry, attr)
337  Else error = simple_setattr - setattr for simple filesystem*@dentry: dentry*@iattr: iattr structure* Returns 0 on success, -error on failure
340  If Not error Then
341  snotify_change - notify_change event. file was modified and/or metadata* was changed.
342  ima_inode_post_setattr(dentry)
343  evm_inode_post_setattr(dentry, ia_valid)
346  Return error
Caller
NameDescribe
chmod_common
chown_common
__remove_privs
utimes_common