Signed-off-by: Pekka Enberg --- fs/namespace.c | 6 ++++++ fs/revoke.c | 18 +++++++++++++++++- include/linux/fs.h | 2 ++ 3 files changed, 25 insertions(+), 1 deletion(-) Index: 26-mm/fs/namespace.c =================================================================== --- 26-mm.orig/fs/namespace.c 2007-05-22 22:19:57.000000000 +0300 +++ 26-mm/fs/namespace.c 2007-05-22 22:31:35.000000000 +0300 @@ -658,6 +658,12 @@ static int do_umount(struct vfsmount *mn sb->s_op->umount_begin(mnt, flags); unlock_kernel(); + if (flags & MNT_FORCE) { + retval = quiesce_filesystem(mnt); + if (retval) + return retval; + } + /* * No sense to grab the lock for this test, but test itself looks * somewhat bogus. Suggestions for better replacement? Index: 26-mm/fs/revoke.c =================================================================== --- 26-mm.orig/fs/revoke.c 2007-05-22 22:31:33.000000000 +0300 +++ 26-mm/fs/revoke.c 2007-05-22 22:33:51.000000000 +0300 @@ -39,6 +39,7 @@ struct fileset { * been revoked */ struct revoke_details { + struct vfsmount *mnt; struct inode *inode; struct file *to_exclude; struct fileset *fset; @@ -134,7 +135,10 @@ static inline bool can_revoke_file(struc if (!file || file == details->to_exclude) return false; - return file->f_dentry->d_inode == details->inode; + if (details->inode && file->f_dentry->d_inode == details->inode) + return true; + + return file->f_path.mnt == details->mnt; } static int revoke_fds(struct task_struct *tsk, struct revoke_details *details) @@ -666,6 +670,18 @@ asmlinkage long sys_frevoke(unsigned int return err; } +int quiesce_filesystem(struct vfsmount *mnt) +{ + struct revoke_details details; + + // TODO: + // - revoke pwd and root that hang on to mnt + + details.mnt = mnt; + + return do_revoke(&details); +} + int generic_file_revoke(struct file *file, struct address_space *new_mapping) { struct address_space *mapping = file->f_mapping; Index: 26-mm/include/linux/fs.h =================================================================== --- 26-mm.orig/include/linux/fs.h 2007-05-22 22:19:57.000000000 +0300 +++ 26-mm/include/linux/fs.h 2007-05-22 22:31:35.000000000 +0300 @@ -1661,6 +1661,8 @@ extern int generic_file_revoke(struct fi #define generic_file_revoke NULL #endif +extern int quiesce_filesystem(struct vfsmount *); + extern void file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); extern loff_t no_llseek(struct file *file, loff_t offset, int origin);