Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=47f9940c55c0bdc65188749cae4e841601f513bb
Commit:     47f9940c55c0bdc65188749cae4e841601f513bb
Parent:     c2f1a551dea8b37c2e0cb886885c250fb703e9d8
Author:     Meelap Shah <[EMAIL PROTECTED]>
AuthorDate: Tue Jul 17 04:04:40 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Jul 17 10:23:07 2007 -0700

    knfsd: nfsd4: don't delegate files that have had conflicts
    
    One more incremental delegation policy improvement: don't give out a
    delegation on a file if conflicting access has previously required that a
    delegation be revoked on that file.  (In practice we'll forget about the
    conflict when the struct nfs4_file is removed on close, so this is of 
limited
    use for now, though it should at least solve a temporary problem with
    self-conflicts on write opens from the same client.)
    
    Signed-off-by: "J. Bruce Fields" <[EMAIL PROTECTED]>
    Signed-off-by: Neil Brown <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/nfsd/nfs4state.c        |    4 ++++
 include/linux/nfsd/state.h |    1 +
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 4624988..e4a4c87 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -195,6 +195,8 @@ alloc_init_deleg(struct nfs4_client *clp, struct 
nfs4_stateid *stp, struct svc_f
        struct nfs4_callback *cb = &stp->st_stateowner->so_client->cl_callback;
 
        dprintk("NFSD alloc_init_deleg\n");
+       if (fp->fi_had_conflict)
+               return NULL;
        if (num_delegations > max_delegations)
                return NULL;
        dp = kmem_cache_alloc(deleg_slab, GFP_KERNEL);
@@ -1002,6 +1004,7 @@ alloc_init_file(struct inode *ino)
                list_add(&fp->fi_hash, &file_hashtbl[hashval]);
                fp->fi_inode = igrab(ino);
                fp->fi_id = current_fileid++;
+               fp->fi_had_conflict = false;
                return fp;
        }
        return NULL;
@@ -1328,6 +1331,7 @@ do_recall(void *__dp)
 {
        struct nfs4_delegation *dp = __dp;
 
+       dp->dl_file->fi_had_conflict = true;
        nfsd4_cb_recall(dp);
        return 0;
 }
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
index 732de9c..db348f7 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -224,6 +224,7 @@ struct nfs4_file {
        struct inode            *fi_inode;
        u32                     fi_id;      /* used with stateowner->so_id 
                                             * for stateid_hashtbl hash */
+       bool                    fi_had_conflict;
 };
 
 /*
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to