All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] xfs: return err code if xfs_buf_associate_memory fail
@ 2021-03-23  6:24 Zhen Zhao
  2021-03-23 16:13 ` Darrick J. Wong
  0 siblings, 1 reply; 8+ messages in thread
From: Zhen Zhao @ 2021-03-23  6:24 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, Zhen Zhao

In kernel 3.10, when there is no memory left in the
system, fs_buf_associate_memory can fail, catch the
error and return.

Signed-off-by: Zhen Zhao <zp_8483@163.com>
---
 fs/xfs/xfs_log.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 2e5581bc..32a41bf5 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -1916,8 +1916,11 @@ xlog_sync(
 	if (split) {
 		bp = iclog->ic_log->l_xbuf;
 		XFS_BUF_SET_ADDR(bp, 0);	     /* logical 0 */
-		xfs_buf_associate_memory(bp,
+		error = xfs_buf_associate_memory(bp,
 				(char *)&iclog->ic_header + count, split);
+		if (error)
+			return error;
+
 		bp->b_fspriv = iclog;
 		bp->b_flags &= ~XBF_FLUSH;
 		bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO | XBF_WRITE | XBF_FUA);
-- 
2.27.0



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

* Re: [PATCH v1] xfs: return err code if xfs_buf_associate_memory fail
  2021-03-23  6:24 [PATCH v1] xfs: return err code if xfs_buf_associate_memory fail Zhen Zhao
@ 2021-03-23 16:13 ` Darrick J. Wong
  0 siblings, 0 replies; 8+ messages in thread
From: Darrick J. Wong @ 2021-03-23 16:13 UTC (permalink / raw)
  To: Zhen Zhao; +Cc: linux-xfs

On Tue, Mar 23, 2021 at 02:24:56AM -0400, Zhen Zhao wrote:
> In kernel 3.10, when there is no memory left in the
> system, fs_buf_associate_memory can fail, catch the
> error and return.

You're probably going to need to take this up with your kernel
distributor or the linux stable fixes list, since (AFAICT) none of this
exists in the upstream kernel.

--D

> Signed-off-by: Zhen Zhao <zp_8483@163.com>
> ---
>  fs/xfs/xfs_log.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
> index 2e5581bc..32a41bf5 100644
> --- a/fs/xfs/xfs_log.c
> +++ b/fs/xfs/xfs_log.c
> @@ -1916,8 +1916,11 @@ xlog_sync(
>  	if (split) {
>  		bp = iclog->ic_log->l_xbuf;
>  		XFS_BUF_SET_ADDR(bp, 0);	     /* logical 0 */
> -		xfs_buf_associate_memory(bp,
> +		error = xfs_buf_associate_memory(bp,
>  				(char *)&iclog->ic_header + count, split);
> +		if (error)
> +			return error;
> +
>  		bp->b_fspriv = iclog;
>  		bp->b_flags &= ~XBF_FLUSH;
>  		bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO | XBF_WRITE | XBF_FUA);
> -- 
> 2.27.0
> 
> 

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

* Re: [PATCH v1] xfs: return err code if xfs_buf_associate_memory fail
  2021-03-24  2:12 Zhen Zhao
@ 2021-03-24  6:05 ` Greg KH
  0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2021-03-24  6:05 UTC (permalink / raw)
  To: Zhen Zhao; +Cc: stable

On Tue, Mar 23, 2021 at 10:12:51PM -0400, Zhen Zhao wrote:
> In kernel 3.10, when there is no memory left in the
> system, fs_buf_associate_memory can fail, catch the
> error and return.
> 
> Signed-off-by: Zhen Zhao <zp_8483@163.com>
> ---
>  fs/xfs/xfs_log.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)


<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>

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

* Re: [PATCH v1] xfs: return err code if xfs_buf_associate_memory fail
  2021-03-24  1:06 Zhen Zhao
@ 2021-03-24  6:05 ` Greg KH
  0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2021-03-24  6:05 UTC (permalink / raw)
  To: Zhen Zhao; +Cc: stable

On Tue, Mar 23, 2021 at 09:06:53PM -0400, Zhen Zhao wrote:
> In kernel 3.10, when there is no memory left in the
> system, fs_buf_associate_memory can fail, catch the
> error and return.
> 
> Signed-off-by: Zhen Zhao <zp_8483@163.com>
> ---
>  fs/xfs/xfs_log.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)


<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>

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

* Re: [PATCH v1] xfs: return err code if xfs_buf_associate_memory fail
  2021-03-24  0:57 Zhen Zhao
@ 2021-03-24  6:05 ` Greg KH
  0 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2021-03-24  6:05 UTC (permalink / raw)
  To: Zhen Zhao; +Cc: stable

On Tue, Mar 23, 2021 at 08:57:43PM -0400, Zhen Zhao wrote:
> In kernel 3.10, when there is no memory left in the
> system, fs_buf_associate_memory can fail, catch the
> error and return.
> 
> Signed-off-by: Zhen Zhao <zp_8483@163.com>
> ---
>  fs/xfs/xfs_log.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)


<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>

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

* [PATCH v1] xfs: return err code if xfs_buf_associate_memory fail
@ 2021-03-24  2:12 Zhen Zhao
  2021-03-24  6:05 ` Greg KH
  0 siblings, 1 reply; 8+ messages in thread
From: Zhen Zhao @ 2021-03-24  2:12 UTC (permalink / raw)
  To: stable; +Cc: Zhen Zhao

In kernel 3.10, when there is no memory left in the
system, fs_buf_associate_memory can fail, catch the
error and return.

Signed-off-by: Zhen Zhao <zp_8483@163.com>
---
 fs/xfs/xfs_log.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 2e5581bc..32a41bf5 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -1916,8 +1916,11 @@ xlog_sync(
 	if (split) {
 		bp = iclog->ic_log->l_xbuf;
 		XFS_BUF_SET_ADDR(bp, 0);	     /* logical 0 */
-		xfs_buf_associate_memory(bp,
+		error = xfs_buf_associate_memory(bp,
 				(char *)&iclog->ic_header + count, split);
+		if (error)
+			return error;
+
 		bp->b_fspriv = iclog;
 		bp->b_flags &= ~XBF_FLUSH;
 		bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO | XBF_WRITE | XBF_FUA);
-- 
2.27.0


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

* [PATCH v1] xfs: return err code if xfs_buf_associate_memory fail
@ 2021-03-24  1:06 Zhen Zhao
  2021-03-24  6:05 ` Greg KH
  0 siblings, 1 reply; 8+ messages in thread
From: Zhen Zhao @ 2021-03-24  1:06 UTC (permalink / raw)
  To: stable; +Cc: Zhen Zhao

In kernel 3.10, when there is no memory left in the
system, fs_buf_associate_memory can fail, catch the
error and return.

Signed-off-by: Zhen Zhao <zp_8483@163.com>
---
 fs/xfs/xfs_log.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 2e5581bc..32a41bf5 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -1916,8 +1916,11 @@ xlog_sync(
 	if (split) {
 		bp = iclog->ic_log->l_xbuf;
 		XFS_BUF_SET_ADDR(bp, 0);	     /* logical 0 */
-		xfs_buf_associate_memory(bp,
+		error = xfs_buf_associate_memory(bp,
 				(char *)&iclog->ic_header + count, split);
+		if (error)
+			return error;
+
 		bp->b_fspriv = iclog;
 		bp->b_flags &= ~XBF_FLUSH;
 		bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO | XBF_WRITE | XBF_FUA);
-- 
2.27.0


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

* [PATCH v1] xfs: return err code if xfs_buf_associate_memory fail
@ 2021-03-24  0:57 Zhen Zhao
  2021-03-24  6:05 ` Greg KH
  0 siblings, 1 reply; 8+ messages in thread
From: Zhen Zhao @ 2021-03-24  0:57 UTC (permalink / raw)
  To: stable; +Cc: Zhen Zhao

In kernel 3.10, when there is no memory left in the
system, fs_buf_associate_memory can fail, catch the
error and return.

Signed-off-by: Zhen Zhao <zp_8483@163.com>
---
 fs/xfs/xfs_log.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 2e5581bc..32a41bf5 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -1916,8 +1916,11 @@ xlog_sync(
 	if (split) {
 		bp = iclog->ic_log->l_xbuf;
 		XFS_BUF_SET_ADDR(bp, 0);	     /* logical 0 */
-		xfs_buf_associate_memory(bp,
+		error = xfs_buf_associate_memory(bp,
 				(char *)&iclog->ic_header + count, split);
+		if (error)
+			return error;
+
 		bp->b_fspriv = iclog;
 		bp->b_flags &= ~XBF_FLUSH;
 		bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO | XBF_WRITE | XBF_FUA);
-- 
2.27.0


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

end of thread, other threads:[~2021-03-24  6:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-23  6:24 [PATCH v1] xfs: return err code if xfs_buf_associate_memory fail Zhen Zhao
2021-03-23 16:13 ` Darrick J. Wong
2021-03-24  0:57 Zhen Zhao
2021-03-24  6:05 ` Greg KH
2021-03-24  1:06 Zhen Zhao
2021-03-24  6:05 ` Greg KH
2021-03-24  2:12 Zhen Zhao
2021-03-24  6:05 ` Greg KH

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.