Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90946
b: refs/heads/master
c: 49e0d02
h: refs/heads/master
v: v3
  • Loading branch information
Dave Hansen authored and Al Viro committed Apr 19, 2008
1 parent 060b701 commit 551fbce
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aceaf78da92a53f5e1b105649a1b8c0afdb2135c
refs/heads/master: 49e0d02cf018d4edf24bfc8531a816a26367e4ce
21 changes: 19 additions & 2 deletions trunk/fs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <linux/idr.h>
#include <linux/kobject.h>
#include <linux/mutex.h>
#include <linux/file.h>
#include <asm/uaccess.h>


Expand Down Expand Up @@ -567,10 +568,26 @@ static void mark_files_ro(struct super_block *sb)
{
struct file *f;

retry:
file_list_lock();
list_for_each_entry(f, &sb->s_files, f_u.fu_list) {
if (S_ISREG(f->f_path.dentry->d_inode->i_mode) && file_count(f))
f->f_mode &= ~FMODE_WRITE;
struct vfsmount *mnt;
if (!S_ISREG(f->f_path.dentry->d_inode->i_mode))
continue;
if (!file_count(f))
continue;
if (!(f->f_mode & FMODE_WRITE))
continue;
f->f_mode &= ~FMODE_WRITE;
mnt = mntget(f->f_path.mnt);
file_list_unlock();
/*
* This can sleep, so we can't hold
* the file_list_lock() spinlock.
*/
mnt_drop_write(mnt);
mntput(mnt);
goto retry;
}
file_list_unlock();
}
Expand Down

0 comments on commit 551fbce

Please sign in to comment.