Re: [PATCH v3] xfs: introduce task->in_fstrans for transaction reservation recursion protection

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

 



On Mon, Jul 27, 2020 at 12:04 AM Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote:
>
> On Sun, Jul 26, 2020 at 10:57:26AM -0400, Yafang Shao wrote:
> > Bellow comment is quoted from Dave,
>
> FYI, you mean "Below", not "Bellow".  Dave doesn't often bellow.

Ah, thanks for pointing that out. I often make that kind of misstake.

>
> > As a result, we should reintroduce PF_FSTRANS. Because PF_FSTRANS is only
> > set by current, we can move it out of task->flags to avoid being out of PF_
> > flags. So a new flag in_fstrans is introduced.
>
> I don't think we need a new flag for this.  I think you can just set
> current->journal_info to a non-NULL value.

Seems like a good suggestion.
I will think about it.

>
> > +++ b/fs/xfs/xfs_linux.h
> > @@ -111,6 +111,20 @@ typedef __u32                    xfs_nlink_t;
> >  #define current_restore_flags_nested(sp, f)  \
> >               (current->flags = ((current->flags & ~(f)) | (*(sp) & (f))))
> >
> > +static inline unsigned int xfs_trans_context_start(void)
> > +{
> > +     unsigned int flags = current->in_fstrans;
> > +
> > +     current->in_fstrans = 1;
> > +
> > +     return flags;
> > +}
> > +
> > +static inline void xfs_trans_context_end(unsigned int flags)
> > +{
> > +     current->in_fstrans = flags ? 1 : 0;
> > +}
>
> Does XFS support nested transactions?  If we're just using
> current->journal_info, we can pretend its an unsigned long and use it
> as a counter rather than handle the nesting the same way as the GFP flags.
>


-- 
Thanks
Yafang



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux