Commit 6f7c877c authored by Ahelenia Ziemiańska's avatar Ahelenia Ziemiańska Committed by Jan Kara
Browse files

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: default avatarAhelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Link: https://patch.msgid.link/iyvn6qjotpu6cei5jdtsoibfcp6l6rgvn47cwgaucgtucpfy2s@tarta.nabijaczleweli.xyz


Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 635bc4de
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
#include <linux/fs.h>
#include <linux/security.h>
#include <linux/fscrypt.h>
#include <linux/fsnotify.h>
#include <linux/fileattr.h>
#include <linux/export.h>
#include <linux/syscalls.h>
@@ -298,6 +299,7 @@ int vfs_fileattr_set(struct mnt_idmap *idmap, struct dentry *dentry,
		err = inode->i_op->fileattr_set(idmap, dentry, fa);
		if (err)
			goto out;
		fsnotify_xattr(dentry);
	}

out: