Re: [PATCH] ceph: don't allow cross-quota link

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 14 Aug 2018, Yan, Zheng wrote:
> On Sat, Aug 11, 2018 at 12:17 AM Gregory Farnum <gfarnum@xxxxxxxxxx> wrote:
> >
> > This needs to be consistent across kernel- and user-space, and I
> > believe we settled on continuing to allow cross-quota links (despite
> > the accounting issues) because otherwise the introduction of new
> > quotas makes it incredibly messy. Unless I missed a change, Zheng?
> > -Greg
> >
> 
> I agree with Greg

Yeah, agree on consistency.

Should this be a hard-coded behavior, or should it be a configurable 
paramter of the file system whether cross-quota links are allowed?

s


> 
> Regards
> Yan, Zheng
> 
> > On Fri, Aug 10, 2018 at 2:57 AM, Chengguang Xu <cgxu519@xxxxxxx> wrote:
> > > Currently, we allow making hard link bewteen different
> > > quota realms and it may cause inaccurate quota accouting.
> > > This patch adds quota realm check when doing hard link.
> > >
> > > Signed-off-by: Chengguang Xu <cgxu519@xxxxxxx>
> > > ---
> > >  fs/ceph/dir.c | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > >
> > > diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
> > > index 82928cea0209..87fa996dbad4 100644
> > > --- a/fs/ceph/dir.c
> > > +++ b/fs/ceph/dir.c
> > > @@ -993,6 +993,10 @@ static int ceph_link(struct dentry *old_dentry, struct inode *dir,
> > >         if (ceph_snap(dir) != CEPH_NOSNAP)
> > >                 return -EROFS;
> > >
> > > +       /* don't allow cross-quota link */
> > > +       if (!ceph_quota_is_same_realm(d_inode(old_dentry), dir))
> > > +               return -EXDEV;
> > > +
> > >         dout("link in dir %p old_dentry %p dentry %p\n", dir,
> > >              old_dentry, dentry);
> > >         req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_LINK, USE_AUTH_MDS);
> > > --
> > > 2.17.1
> > >
> 
> 



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux