All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiaju Zhang <jjzhang.linux@gmail.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH V3] Fix the nested PR lock calling issue	in ACL
Date: Tue, 27 Jul 2010 11:16:49 +0800	[thread overview]
Message-ID: <20100727031649.GA11633@linux-jjzhang> (raw)
In-Reply-To: <20100726120826.GA2398@laptop>

On Mon, Jul 26, 2010 at 08:08:27PM +0800, Wengang Wang wrote:
> On 10-07-26 18:36, Jiaju Zhang wrote:
> > Oh, this is a slight change of the patch I just posted, since the
> > original one may have wrongly processing of error return code. So
> > please review this one instead;)
> > 
> > Thanks a lot,
> > Jiaju
> > 
> > Signed-off-by: Jiaju Zhang <jjzhang@suse.de>
> > ---
> >  fs/ocfs2/acl.c |   20 ++++++++++++++++++--
> >  1 files changed, 18 insertions(+), 2 deletions(-)
> > 
> > diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c
> > index da70229..28a25b8 100644
> > --- a/fs/ocfs2/acl.c
> > +++ b/fs/ocfs2/acl.c
> > @@ -290,12 +290,28 @@ static int ocfs2_set_acl(handle_t *handle,
> >  
> >  int ocfs2_check_acl(struct inode *inode, int mask)
> >  {
> > -	struct posix_acl *acl = ocfs2_get_acl(inode, ACL_TYPE_ACCESS);
> > +	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
> > +	struct buffer_head *di_bh = NULL;
> > +	struct posix_acl *acl;
> > +	int ret = -EAGAIN;
> > +
> > +	if (!(osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL))
> > +		return ret;
> > +
> > +	ret = ocfs2_read_inode_block(inode, &di_bh);
> > +	if (ret < 0) {
> > +		mlog_errno(ret);
> > +		return ret;
> > +	}
> > +
> > +	acl = ocfs2_get_acl_nolock(inode, ACL_TYPE_ACCESS, di_bh);
> > +
> > +	brelse(di_bh);
> >  
> >  	if (IS_ERR(acl))
> 
> Could you log this error? though it's not part of the fix.
> Otherwise, ack.

Hi Wengang, many thanks;)

Yes, I can add a log like

+               mlog_errno(PTR_ERR(acl));

But I'm wondering if we really need to add the log? Since there are
many places calling like
        if (IS_ERR(acl))
                return PTR_ERR(acl);
and some other filesystems such as ext3, ext4, btrfs didn't log this
error at this point as well.

Thanks,
Jiaju

> 
> regards,
> wengang.
> >  		return PTR_ERR(acl);
> >  	if (acl) {
> > -		int ret = posix_acl_permission(inode, acl, mask);
> > +		ret = posix_acl_permission(inode, acl, mask);
> >  		posix_acl_release(acl);
> >  		return ret;
> >  	}

  reply	other threads:[~2010-07-27  3:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-26  4:36 [Ocfs2-devel] [PATCH V3] Fix the nested PR lock calling issue in ACL Jiaju Zhang
2010-07-26 10:36 ` Jiaju Zhang
2010-07-26 12:08   ` Wengang Wang
2010-07-27  3:16     ` Jiaju Zhang [this message]
2010-07-27 20:27   ` Mark Fasheh

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=20100727031649.GA11633@linux-jjzhang \
    --to=jjzhang.linux@gmail.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.