Skip to content

Commit 6f7c877

Browse files
nabijaczlewelijankara
authored andcommitted
fs: send fsnotify_xattr()/IN_ATTRIB from vfs_fileattr_set()/chattr(1)
Currently it seems impossible to observe these changes to the file's attributes. It's useful to be able to do this to see when the file becomes immutable, for example, so emit IN_ATTRIB via fsnotify_xattr(), like when changing other inode attributes. Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Link: https://patch.msgid.link/iyvn6qjotpu6cei5jdtsoibfcp6l6rgvn47cwgaucgtucpfy2s@tarta.nabijaczleweli.xyz Signed-off-by: Jan Kara <jack@suse.cz>
1 parent 635bc4d commit 6f7c877

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

fs/file_attr.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <linux/fs.h>
33
#include <linux/security.h>
44
#include <linux/fscrypt.h>
5+
#include <linux/fsnotify.h>
56
#include <linux/fileattr.h>
67
#include <linux/export.h>
78
#include <linux/syscalls.h>
@@ -298,6 +299,7 @@ int vfs_fileattr_set(struct mnt_idmap *idmap, struct dentry *dentry,
298299
err = inode->i_op->fileattr_set(idmap, dentry, fa);
299300
if (err)
300301
goto out;
302+
fsnotify_xattr(dentry);
301303
}
302304

303305
out:

0 commit comments

Comments
 (0)