linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* hpfs_setattr error case avoids unlock_kernel ?
@ 2010-12-12  0:49 Dr. David Alan Gilbert
  2010-12-13 16:03 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Dr. David Alan Gilbert @ 2010-12-12  0:49 UTC (permalink / raw)
  To: mikulas, hch; +Cc: linux-fsdevel

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   |_______/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-02-07 15:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-12  0:49 hpfs_setattr error case avoids unlock_kernel ? Dr. David Alan Gilbert
2010-12-13 16:03 ` 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

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).