Skip to content

Commit db6a55a

Browse files
committed
Merge branch 'aufs5.1/00base' into aufs5.2/00base
2 parents a1c5566 + b563d9f commit db6a55a

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

fs/aufs/branch.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1205,6 +1205,7 @@ static int au_br_mod_files_ro(struct super_block *sb, aufs_bindex_t bindex)
12051205
unsigned char verbose, writer;
12061206
struct file *file, *hf, **array;
12071207
struct au_hfile *hfile;
1208+
struct inode *h_inode;
12081209

12091210
mnt_flags = au_mntflags(sb);
12101211
verbose = !!au_opt_test(mnt_flags, VERBOSE);
@@ -1275,7 +1276,10 @@ static int au_br_mod_files_ro(struct super_block *sb, aufs_bindex_t bindex)
12751276
hf->f_mode &= ~(FMODE_WRITE | FMODE_WRITER);
12761277
spin_unlock(&hf->f_lock);
12771278
if (writer) {
1278-
put_write_access(file_inode(hf));
1279+
h_inode = file_inode(hf);
1280+
if (hf->f_mode & FMODE_READ)
1281+
i_readcount_inc(h_inode);
1282+
put_write_access(h_inode);
12791283
__mnt_drop_write(hf->f_path.mnt);
12801284
}
12811285
}

fs/aufs/vfsub.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,8 @@ int vfsub_update_h_iattr(struct path *h_path, int *did)
6363

6464
struct file *vfsub_dentry_open(struct path *path, int flags)
6565
{
66-
struct file *file;
67-
68-
file = dentry_open(path, flags /* | __FMODE_NONOTIFY */,
66+
return dentry_open(path, flags /* | __FMODE_NONOTIFY */,
6967
current_cred());
70-
if (!IS_ERR_OR_NULL(file)
71-
&& (file->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ)
72-
i_readcount_inc(d_inode(path->dentry));
73-
74-
return file;
7568
}
7669

7770
struct file *vfsub_filp_open(const char *path, int oflags, int mode)

0 commit comments

Comments
 (0)