lkml.org 
[lkml]   [2015]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.4 158/177] nfs: Fix use of uninitialized variable in nfs_getattr()
    Date
    From: Jan Kara <jack@suse.cz>

    3.4.106-rc1 review patch. If anyone has any objections, please let me know.

    ------------------


    commit 16caf5b6101d03335b386e77e9e14136f989be87 upstream.

    Variable 'err' needn't be initialized when nfs_getattr() uses it to
    check whether it should call generic_fillattr() or not. That can result
    in spurious error returns. Initialize 'err' properly.

    Signed-off-by: Jan Kara <jack@suse.cz>
    Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
    Signed-off-by: Zefan Li <lizefan@huawei.com>
    ---
    fs/nfs/inode.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
    index 9bb4e5c..a6d5905 100644
    --- a/fs/nfs/inode.c
    +++ b/fs/nfs/inode.c
    @@ -512,7 +512,7 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
    {
    struct inode *inode = dentry->d_inode;
    int need_atime = NFS_I(inode)->cache_validity & NFS_INO_INVALID_ATIME;
    - int err;
    + int err = 0;

    /* Flush out writes to the server in order to update c/mtime. */
    if (S_ISREG(inode->i_mode)) {
    --
    1.9.1


    \
     
     \ /
      Last update: 2015-01-28 05:41    [W:5.621 / U:0.188 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site