From d635711daa98be86d4c7fd01499c34f566b54ccb Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Fri, 10 Jun 2016 05:30:17 -0300 Subject: Linux-libre 4.6.2-gnu --- fs/aufs/export.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'fs/aufs/export.c') diff --git a/fs/aufs/export.c b/fs/aufs/export.c index 69b70f2a1..8755b1ef0 100644 --- a/fs/aufs/export.c +++ b/fs/aufs/export.c @@ -500,9 +500,11 @@ struct dentry *decode_by_path(struct super_block *sb, ino_t ino, __u32 *fh, h_mnt = au_br_mnt(br); h_sb = h_mnt->mnt_sb; /* todo: call lower fh_to_dentry()? fh_to_parent()? */ + lockdep_off(); h_parent = exportfs_decode_fh(h_mnt, (void *)(fh + Fh_tail), fh_len - Fh_tail, fh[Fh_h_type], h_acceptable, /*context*/NULL); + lockdep_on(); dentry = h_parent; if (unlikely(!h_parent || IS_ERR(h_parent))) { AuWarn1("%s decode_fh failed, %ld\n", @@ -606,7 +608,7 @@ aufs_fh_to_dentry(struct super_block *sb, struct fid *fid, int fh_len, /* is the parent dir cached? */ br = au_sbr(sb, nsi_lock.bindex); - atomic_inc(&br->br_count); + au_br_get(br); dentry = decode_by_dir_ino(sb, ino, dir_ino, &nsi_lock); if (IS_ERR(dentry)) goto out_unlock; @@ -630,7 +632,7 @@ accept: dentry = ERR_PTR(-ESTALE); out_unlock: if (br) - atomic_dec(&br->br_count); + au_br_put(br); si_read_unlock(sb); out: AuTraceErrPtr(dentry); @@ -697,7 +699,7 @@ static int aufs_encode_fh(struct inode *inode, __u32 *fh, int *max_len, err = -EIO; parent = NULL; ii_read_lock_child(inode); - bindex = au_ibstart(inode); + bindex = au_ibtop(inode); if (!dir) { dentry = d_find_any_alias(inode); if (unlikely(!dentry)) @@ -772,7 +774,7 @@ static int aufs_commit_metadata(struct inode *inode) sb = inode->i_sb; si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW); ii_write_lock_child(inode); - bindex = au_ibstart(inode); + bindex = au_ibtop(inode); AuDebugOn(bindex < 0); h_inode = au_h_iptr(inode, bindex); @@ -808,6 +810,11 @@ void au_export_init(struct super_block *sb) struct au_sbinfo *sbinfo; __u32 u; + BUILD_BUG_ON_MSG(IS_BUILTIN(CONFIG_AUFS_FS) + && IS_MODULE(CONFIG_EXPORTFS), + AUFS_NAME ": unsupported configuration " + "CONFIG_EXPORTFS=m and CONFIG_AUFS_FS=y"); + sb->s_export_op = &aufs_export_op; sbinfo = au_sbi(sb); sbinfo->si_xigen = NULL; -- cgit v1.2.3-54-g00ecf