Re: [PATCH v2 1/1] ftruncate, truncate: create fanotify events

From: Heinrich Schuchardt
Date: Fri Nov 14 2014 - 16:36:21 EST


Hello Jan,

thank you for the review.

On 14.11.2014 11:01, Jan Kara wrote:

We only want to create FAN_MODIFY events for ATTR_SIZE. So only for
these events we need a path.

To my knowledge notify_change is called with ATTR_SIZE from
do_truncate(), ecryptfs_truncate() and will be called with ATTR_SIZE
from ovl_setattr() for a truncation.
There's also a call in fs/cachefiles/interface.c: cachefiles_attr_changed()
and fs/hpfs/namei.c: hpfs_unlink() and nfs plays with ATTR_SIZE although I
wasn't able to track down whether it actually passes it to notify_change().

cachefiles_attr_changed() contains two calls to notify_change(). Both calls pass ATTR_SIZE as sole attribute.

In cachefiles_attr_changed() we can create a path object with
path.dentry = object->backer;
path.mnt = cache->mnt;

In hpfs_unlink() a truncation occurs only if deletion fails.
I do not see how to access a path here.

notify_change() is not called in directory fs/nfs.
grep -GHrn notify_change fs/nfs/
This does not test for any indirect call.

Best regards

Heinrich Schuchardt


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/