linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <linux@treblig.org>
To: mikulas@artax.karlin.mff.cuni.cz, hch@lst.de
Cc: linux-fsdevel@vger.kernel.org
Subject: hpfs_setattr error case avoids unlock_kernel ?
Date: Sun, 12 Dec 2010 00:49:47 +0000	[thread overview]
Message-ID: <20101212004947.GA9138@gallifrey> (raw)

Hi,
  'sparse' pointed out to me the code in fs/hpfs/inode.c:hpfs_setattr
changed by Christoph's patch 1025774ce411f2bd4b059ad7b53f0003569b74fa
'remove inode_setattr', and it does look like the error path 
avoids an unlock_kernel (around like 284 of fs/hpfs/inode.c)

fs/hpfs/inode.c:265:5: warning: context imbalance in 'hpfs_setattr' - different lock contexts for basic block

--------------------------
       error = inode_change_ok(inode, attr);
        if (error)
                goto out_unlock;

        if ((attr->ia_valid & ATTR_SIZE) &&
            attr->ia_size != i_size_read(inode)) {
                error = vmtruncate(inode, attr->ia_size);
                if (error)
************            return error;
        }

        setattr_copy(inode, attr);
        mark_inode_dirty(inode);

        hpfs_write_inode(inode);

 out_unlock:
        unlock_kernel();
        return error;
--------------------------

it looks like that 1st 'return error' needs to change into a goto out_unlock;

Dave

-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\ gro.gilbert @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

             reply	other threads:[~2010-12-12  1:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-12  0:49 Dr. David Alan Gilbert [this message]
2010-12-13 16:03 ` hpfs_setattr error case avoids unlock_kernel ? Christoph Hellwig
2010-12-13 17:09   ` [PATCH] hpfs_setattr error case avoids unlock_kernel Dr. David Alan Gilbert
2011-02-07 15:31     ` Mikulas Patocka
2011-02-07 15:31   ` hpfs_setattr error case avoids unlock_kernel ? Mikulas Patocka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101212004947.GA9138@gallifrey \
    --to=linux@treblig.org \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mikulas@artax.karlin.mff.cuni.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).